A self-righteous person acts superior to his peers because he believes his moral standards are perfect. This "moral smugness" is condescending by nature and is usually found offensive by others.
Self-righteousness is a way unintelligent and nonathletic people can retain a sense of superiority. Various cults and religions promote self-righteousness in an attempt to convert the average person, who feels immoral by comparison.
Joe: Hey, I downloaded this awesome movie! Want to go watch it?
Tim: You DOWNLOADED it?
Tim: *Sigh* That's immoral and against the law. I would never do that.
Joe: You're a self-righteous tool
Being smugly superior morally to everyone else.
Normal Guy: Hey want to go get a beer?
Guy #2: No sorry, drinking destroys the mind and body. You shouldn't drink.
Normal Guy: What a self righteous bastard.