The annoying trait of acting morally superior to others is called sanctimony. Your brother's sanctimony about being quiet after nine o'clock might make you want to have a loud dance party at midnight.
When you find yourself giving an insincere, smug lecture to your friends about the way they should behave or the things they ought to do, you're guilty of sanctimony. Before this word (and its partner, sanctimonious) gained its modern meaning, it was used un-ironically, to mean "virtuousness." It comes from the Latin sanctimonia, "holiness," from the root sanctus, "holy."