In essence, it isn't just that Religion is beneficial to humans, but that Religion itself is an idea that self-replicates due to its nature.
wnope,
Welcome to EvC. I find this line of inquirey very interesting but very complex. With agriculture supplying a surplus of food an area could support a larger population and some members were freed from subsistence duties to provide a ruling class, a priest class, and soldiers, artists and etc. As you point out religion is an integral part of early civilization. Government, science, health, history, and art were all combined in religion.
I think science and rationality are emerging as a new function for humans and this development is a new challenge just as at one time agricultural and a settled life in large populations was a challenge over the hunter gatherer bands of early man.
I think one way of looking at this forum is the dialogue between traditionalists and "early adopters" of a scientific rational approach.
I'm looking forward to reading more of your thoughts on this.
lfen