From Jonathan Haidt's book The Happiness Hypothesis:
The gap between action and perception is bridged by the art of impression management. If life itself is what you deem it, then why not focus your efforts on persuading others to believe that you are a virtuous and trustworthy cooperator?
Natural selection, like politics, works by the principle of survival of the fittest, and several researchers have argued that human beings evolved to play the game of life in a Machiavellian way. The Machiavellian version of tit for tat… is to do all you can to cultivate the reputation of a trustworthy yet vigilant partner, whatever reality may be.
The simplest way to cultivate a reputation for being fair is to really be fair, but life and psychology experiments sometimes force us to choose between appearance and reality. The findings are not pretty. … The tendency to value the appearance of morality over reality has been dubbed “moral hypocrisy”.
… Proving that people are selfish, or that they'll sometimes cheat when they know they won't be caught, seems like a good way to get an article into the Journal of Incredibly Obvious Results. What's not so obvious is that, in nearly all these studies, people don't think they are doing anything wrong. It's the same in real life. From the person who cuts you off on the highway all the way to the Nazis who ran the concentration camps, most people think they are good people and they their actions are motivated by good reasons. Machiavellian tit for tat requires devotion to appearances, including protestations of one’s virtue even when one chooses vice. And such protestations are most effective when the person making them really believes them.
As Robert Wright puts it in his masterful book The Moral Animal, “Human beings are a species splendid in their array of moral equipment, tragic in their propensity to misuse it, and pathetic in their constitutional ignorance of the misuse.