And in the real world, nothing is black and white. So rules cannot be applied everywhere. Not everyone thinks the same on every issue. I can agree that universally we all believe in some preservation of wellbeing. But we all have different ideas on how to preserve wellbeing, and some think that it is only for certain people. Now with rules, people who regard rules as sacred and unquestionable have a sense of disgust when the rules are not followed.
Conformity and blind obedience do not make people self-righteous. Higher education is what makes people self-righteous. Give any ignorant brat a college education and watch its ego inflate to the size of a hot air balloon and carry it far into the sky beyond the limits of common sense and reality.
Although some people can be self-righteous conformists that are blindly obedient, one does not lead to the other and all people that are blindly obedient or conformists are not self-righteous just as all people that are self-righteous are not conformists or blindly obedient. I find the three tend to go together the most in the cases of strict organized religions, but even then to generalize that everyone is the same would be an overreach.