Once upon a time the entire world was ruled by religion and Kings and Queens that forced religion upon you lest your head be lopped off. In this strange land, you quietly did as you were told so you could keep your head attached to your body. You were assigned a station in life upon your birth and it was indeed a rare thing to be able to change it during your life, without luck and some blackmail.
Then one day a new world was found. In time the people that founded this new world decided that anyone no matter their status at birth, could become whatever they wanted if they worked hard enough. They also decided that religion although important to maintaining a level of decency in society, would never be assigned by the ruler but instead be chosen by the individual.
It was awesome. First civilized society of it's kind. No Kings, No Queens and no forced religion. How wonderful, how profound, how genius. They knew the people couldn't just go all willy nilly batshit with all this freedom. They also realized that even without Kings or Queens someone has to be in charge of super big deal stuff, which means power. As they say, "with great power comes great responsibility". It's far to easy for any leader to fall back into the "luck", "blackmail" situation. It's far to easy for someone in charge to indeed go full speed frog in a blender insane.
Being super smart. They decided to put down some rules and guidelines. These were not just for the people, but also those in charge. So no one could go wiggidy whack and start offing people for their beliefs.
Somewhere over the years the system the plan the guidelines got seriously diluted, messed up and twisted.