Why are women often treated almost like second class citizens in a lot of mainstream religions?

Controversial question day today!

It seems to me that in some of the bigger mainstream religions that women are often expected to serve the man, obey the man's word, and live a life according to men's rules. I am guessing that's because of how men were the ones to write those religious texts and they were strong in their beliefs that men were the dominant ones (and I am being extremely nice in that description. I actually believe far worse about them). Keep in mind that I am not just talking about Western culture being an influence here although it absolutely still plays a part when talking about religion.

So why (or who not) do you think women are treated like second class citizens in mainstream religions?
Why are women often treated almost like second class citizens in a lot of mainstream religions?
Post Opinion