Red, theory; black, fact.
I will be arguing here that the Darwinian selective advantage to humans of having a propensity for religion is that it regulates the pace of introduction of new technology, which is necessitated by the disruptive side effects of new technology.
If this sounds like a weak argument, perhaps people have been chronically underestimating the costs to society of the harmful side effects of new technology, ever since there have been people. Take the downside of the taming of fire, for instance. You can bet that the first use would have been military, just as in the case of nuclear energy. Remember that everything was covered in forests in those days; there must have been an appalling time of fire until kin selection slowly put a stop to it. The lake-bottom charcoal deposits will still be there, if anyone cares to look for them. (Shades of Asimov's story "Nightfall.")
The sedimentary record does not seem to support the idea that the smoke from such a time of fire caused a planetary cooling event sufficient to trigger the last ice age. However, the mere possibility helps to drive home the point, namely that prehistoric, evolutionary-milieu technology was not necessarily too feckless to produce enough disruption to constitute a source of selection pressure.
Natural selection could have built a rate-of-innovation controller by exaggerating people's pleasure at discovering a new, unexplored phenomenon, until they bog down in rapture at that moment and never progress to the next step of actually experimenting or exploring. The latter activities would be just upstream of the nominally controlled process, the introduction of new technology. People's tendency for "rapture capture" would be causally linked via genetically specified neural pathways to the kinds of hardships caused by technological side effects, thereby completing a negative feedback loop that would work like a steam engine governor.
I conjecture that all present-day religions are built on this phenomenon of "rapture capture." This may explain why the most innovative country, the USA, is also the most religiose, according to Dawkins, writing in "The God Delusion." An Einsteinian sense of wonder at the cosmos that, according to Dawkins, most scientists feel, could be a mild, non-capturing version of the same thing. The unlikely traits attributed to God, omnipotence, omni this and that, could have instrumental value in intensifying the rapture.
Another possible name for what I have been calling rapture could be "arcanaphilia." A basic insight for me here was that religion is fundamentally hedonistic. I do not seem to be straying too far from Marx's statement that "Religion is the opiate of the people."
These ideas help to explain why some sciences such as astronomy and chemistry began as inefficient protosciences (e.g., astrology, alchemy): they were inhibited from the start by an excessive sense of wonder, until harder heads eventually prevailed (Galileo, Lavoisier). Seen as a protoscience, the Abrahamic religions could originally have been sparked by evidence that "someone is looking out for us" found in records of historical events such as those the ancient Israelites compiled (of which the Dead Sea Scrolls are a surviving example). That "someone" would in reality be various forms of generation-time compensation, one of which I have been calling the "intermind" in these pages. Perhaps when the subject of study is in reality a powerful aspect of ourselves as populations, the stimulus for rapture capture will be especially effective, explaining why religion has yet to become an experimental science.
By the way, there is usually no insurmountable difficulty in experimenting on humans so long as the provisions of the Declaration of Helsinki are observed: volunteer basis only; controlled, randomized, double-blind study; experiment thoroughly explained to volunteers before enrollment; written consent obtained from all volunteers before enrollment; approval of the experimental design obtained in advance from the appropriate institutional ethics committee; and the experiment registered online with the appropriate registry.
Religions seem to be characterized by an unmistakable style made up of little touches that exaggerate the practitioner's sense of wonder and mystery, thus, their arcanaphilic "high." I refer to unnecessarily high ceilings in places of worship, use of enigmatic symbols, putting gold leaf on things, songs with Italian phrases in the score, such as "maestoso," wearing colorful costumes, etc. I shall refer to all the elements of this style collectively as "bractea," Latin for tinsel or gold leaf. I propose the presence of bractea as a field mark for recognizing religions in the wild. By this criterion, psychiatry is not a religion, but science fiction is.
It seems to me that bractea use can easily graduate into the creation of formal works of art, such as canticles, stained glass windows, statues of the Buddha, and the covers of science fiction magazines. Exposure to concentrations of excessive creativity in places of worship can be expected to drive down the creativity of the worshipers by a negative feedback process evolved to regulate the diversity of the species memeplex, already alluded to in my post titled, "The Intermind: Engine of History?"
This effect should indirectly reduce the rate of introduction of new technology, thereby feeding into the biological mission of religion. Religion could be the epi-evolutionary solution, and the artistic feedback could be the evolutionary solution, to the disorders caused by creativity. Bractea would represent a synergy between the two.