The Messenger of Allah was reported to have said "Actions [al'A'maal] are only to be evaluated with regards to the intention[ft.1], and for all there is due but what he intended. So whosoever has made Hijrah for worldly considerations [Dunya], or for marriage with a woman [ft.2], his hijrah is to what he made hijrah for.[Bukhari, Kitaab Bada' al wahy, 1:1]
This narration is perhaps the most famous hadeeth in the Muslim world. It is quoted by scholars and lay people alike. Partly, it has become so popular because it is the very first narration quoted in many small hadeeth anthologies, such as An Nawawi's Al Arba'een An Nawawiyyah [forty hadeeth], and of course it is the very first narration found in Saheeh Al Bukhari. For the sake of brevity and focus, we have omitted the chain of transmitters [Isnaad] as well as any discussion on it.
The immediate implications or understanding of this narration are obvious. Due to the lack of freedom of religion, constant persecution and dangers, the followers of the Prophet, upon whom be peace and blessings, had to make hijrah, meaning they had to migrate to places where their spiritual development would not be arrested. The first migrants went to Abyssinia, wherein the local authorities treated the Muslims with respect. Eventually, the Prophet himself, Sall Allahu 'alayhi wa sallam, went to Yathrib, which later on became known as Madinah al Munawwarrah, or Madinat un Nabi, the Prophet's city, or simply Madinah for short. It was in Madinah that the base of Islam was established.
The importance of Ikhlas, sincerely doing something because you want that act to be counted as an act of virtue or a means to attain closeness to Allah, is given here, as well as throughout the Qur'an and many other Prophetic narrations. Indeed, this teaching regarding Ikhlas is apparent in something like Prayer itself. Before prayer, one must have "intention" before reciting the opening Takbeer. "O Allah, it is my intention to offer such and such salaah for your sake" or any similar expression. This can also be done in the heart, rather than verbal. None can know when you offer the ritual of prayer or the ritual of fasting that you are truly doing it for Allah or doing it in order to be seen, to conform to social expectations.
Applying this hadeeth in human interactions
The first lines of the narration "actions are only to be evaluated with regards to intention" certainly have applications in the physical world, in the relationships between family members, spouses and friends. If the intention [Niyyah] is good within a person, then the other person making judgment on it should take that into consideration. Indeed, according to the Messenger of God, this is the only thing[ft.3] that should be used to base the judgements on. This hadeeth does not advocate being naive or a simpleton, but it does advocate what is generally taught in Islam, and that is the concept of positive conjecture, Husnudh dhann [ft.4]. When the intention is known to be good, actions that result from the intention, especially when those actions have actually have not generated any harm, should not be held against the person.
In life, all people make judgements, have egos and make mistakes. Holding things against others, especially when intention was always good, is another sign of an unhealthy spiritual situation. A situation that is best resolved by contemplation, supplication to Allah, consulting the book of Allah and people of wisdom[ft.5].
 This is my translation, but in the article title I have retained the usual English rendering. The Arabic words are Innamal 'a'maalu bin niyyat.
 In Saheeh Al Bukhari the words Imra-atan yatazawwajuhaa appear, whereas the text used by Imam An Nawawi has the words Imra-atan yankihuhaa. Both phrases have the same meaning, marriage with a woman.
 The word Innama, which is the first word in the Arabic text, is a particle of restriction [Hasr] in grammar. Thus, we have rendered it, in context, as " actions are only to be evaluated with regards to the intention". Also see footnote 1 above.
 This concept is explained further in http://shamsuddinwaheed.blogspot.com/2013/07/towards-healthy-spiritual-life.html.
 Qur'an 4:35 teaches, as an example, that when a marriage problem emerges, parties from both the husband and wife are to work to solve it. This serves many benefits, including preserving the privacy and standing of the couple.