Some guy a few thousand years ago...
"Well, I wasn't born into the ruling family. I'm too skinny to be a warrior general. But I'm smart and see how stupid the rest of the world is...how do I get power and control? **lightbulb moment**(which is pretty cool cuz lighbulbs won't be invented for millenia)...I'll start a religion! Then everyone will either give me money and let me run their lives or I'll threaten them that the god who loves them will condemn them to an eternity in fire"
"And if I play this right I can even get the king to submit to me because I'll convince him that my fairy-sky-man is the one who has granted him power"
"Hang on!!! I can subjugate women and have as many little boys as sex toys as I want too!!!"
Thus, the church was born.