Religion was invented 1) for weak men to wield power over strong men ( priests in the past, and some even these days, enjoy telling kings and sheikhs and other rulers what to do and what not to do)
and
2) to give men the right to control women, in order to make sure the "sons" who inherit their assets are actually Not cuckoos in their nests - that is, Not the sons of their wives' adultery.
I think somebody on here (was it PP) said oncethat the research shows that the percentage of cuckoos in the nest is strangely unchanging over class and time and is around 8%