By and large humans are not logical, our actions are not logical/rational at least on individual basis. They are rational from a evolutionary species domination POV. We are herd animals. Enforcing "moral standards" is outcome of Herd dynamics. e.g. way to maintain control / "leader of the herd" status and to distinguish other herdmembers.
Less cynically, moral cohesion is important for social cohesion, which is critical for survival. So from that perspective it makes perfect sense. It's just carried too far most of the time.
By and large humans are not logical, our actions are not logical/rational at least on individual basis. They are rational from a evolutionary species domination POV. We are herd animals. Enforcing "moral standards" is outcome of Herd dynamics. e.g. way to maintain control / "leader of the herd" status and to distinguish other herdmembers.