Do you ever wait for a "walk" signal when there's no traffic? When someone else comes along and jaywalks, do you think, "I'm an idiot for waiting?" Or do you think, "That guy's a jerk?" Research suggests that moralizing others' behavior has a lot to do with defending our own egos.

Stanford researchers Alex Jordan and Benoit Monin asked students to perform an optional tedious task while waiting for the "real" experiment to begin. The subjects saw a second student either follow through with the chore or decline without repercussions. People who did the boring task and then witnessed someone refuse rated their own morality higher, and the rebel's morality lower, than did subjects who either did not do the task first or saw the other person obey. We cast ourselves as noble to avoid feeling naive—what Jordan and Monin call the "sucker to saint" effect.

Monin says we judge people on two main axes: morality and competence. In defending your ego, if you can't impugn someone's ethics, you call her stupid. He has preliminary evidence that meat-eaters regard vegetarians who threaten their self-esteem as a little dim. ("It's hard to say that vegetarians are evil.")

And if you can't call ego-threatening individuals evil or stupid, you just plain reject them. In other studies, Monin and collaborators had people perform a racially charged task. The participants were more approving of others who also did the task than they were of people who balked and called it racist.

In contrast, observers not involved in the task actually preferred the rebels over the followers. In a similar juxtaposition, the public often exalts whistleblowers, while insiders who stood by when they could have spoken out aren't always so adoring.

Monin says all these lines of research "are about others' exemplary behavior making you feel like a schmuck." There's a perfect defense, though: self-affirmation. Participants who first wrote about qualities they liked in themselves became more generous in their judgments of rebels' intelligence or morality. "If I make you secure in the fact that you're a great tennis player or a reliable friend, then you can probably feel OK when I point out that you don't recycle enough," he says. "Otherwise you might lash back."

Self-affirmation doesn't just reduce the knee-jerk dismissal of others who break the status quo; it frees us to rethink our own obedience and maybe even to "respond to clever behavior by emulating it," Jordan says. So before hating on that do-gooder in the Prius, step out of the Hummer and give yourself a hug.

Do-gooder derogation

Whistleblowers are often castigated by their peers.

Copter pilot Hugh Thompson halted the My Lai Massacre in Vietnam and was ostracized by other soldiers.

Frank Serpico testified about corruption within the NYPD and was shot in a suspected setup by his fellow officers.

Joseph Darby turned in photos of other Abu Ghraib guards misbehaving and was put under protective custody.