Suppose someone steals your credit cards and cash, leaving your billfold empty of everything but the family pictures. It's no great loss, really: the amount of cash was trivial, and you're not liable for the credit card charges. But if you're like many people, you'll invest non-trivial amounts of time in bringing the culprit to justice. Having found incriminating evidence at the scene of the crime, you'll call the police and do whatever you can to help them find their man.
Assuming you succeed--assuming they find their man--what do you get out of the deal? In material terms, nothing. It's a waste of your time. But you're motivated by moral grievance. "It's the principle of the thing," you say, feeling the point viscerally.
This is one example of how we're all saddled with a primitive moral system. According to evolutionary psychology, our genetic infrastructure for moral indignation was designed by natural selection back when our ancestors lived in small hunter-gatherer societies. But today we don't live in hunter-gatherer societies. The result is a "mismatch" between our genes and our social environment. Genetically based impulses of moral indignation that were built to serve our interests no longer do.
One key difference between modern society and the "ancestral environment" of our evolutionary design is that in the ancestral environment there were no police. If you didn't bring your tormentors to justice, who would? And the price for letting a tormentor off the hook was high. If word got around that you were an easy target--that people could steal your food, steal your mate, or just extract favors from you without ever reciprocating--then you'd pay a price in real Darwinian terms. The chances of your genes getting into the next generation would drop.
In such an environment genes conducive to moral indignation could thrive. By leading you to punish your past exploiters, they could reduce your chances of getting exploited in the future; they could give you a reputation as someone not to be trifled with.
These days, of course, reputation doesn't work the same way. The pickpocket you testify against doesn't spend his time in prison spreading the word that your pocket can't be profitably picked. Still, you find deep gratification in knowing that you've sent the pickpocket to jail--gratification that's a vestige of the pre-police past.
As it happens, the obsolescence of this "moral" impulse has actually made it, in a sense, more truly moral. Though moral indignation may not help the person feeling the indignation, it can help society at large. After all, if no criminals ever got tracked down, the whole judicial system would lose credibility, and all law-abiding citizens would suffer. So when you help finger a culprit, under the sway of an impulse that was originally designed to work selfishly, you're actually performing a selfless service to the larger society. You are investing time and energy in keeping the judicial system sound. It's kind of like jury duty. (Of course, you derive some personal benefit from keeping the overall system sound. But in both cases--with jury duty and with tracking down culprits--your small slice of society's overall benefit from your efforts pales by comparison with the efforts themselves. So in terms of narrow self-interest, the "rational" thing to do is shirk duty in both cases; duty amounts to sacrifice--which is why they call it duty.)
Why do we feel the need to pass judgment in such cases? Here the evolutionary psychology gets a bit more speculative, but the answer seems to go something like this: In the ancestral environment--in a small villagelike setting of 25 or 50 or 75 people--grievances often became public grievances, publicly discussed. And people were designed by natural selection to weigh in on moral issues in ways that ultimately served their genetic interest.
Sometimes this might mean just backing the position of a relative or a friend, conveniently blinding yourself to any countervailing evidence. Other times it might mean arguing for a specific position that, if it became a village-wide principle, could serve you well. (A male who finds himself at the top of the local social hierarchy may think polygamy is a fine thing. A low-status male, who would wind up mateless in a polygamous society, may not.) Or, more generally, as someone who plays by the rules, you may have an interest in defending other such good eggs against rule breakers in the hopes that they'll return the favor in the future.