This is an interesting question IMHO. Does religion confer net benefits or net penalties on a society/people?
I personally reject religion in all its forms, but I acknowledge that it can have benefits. When your child dies of smallpox at age two, it is probably greatly comforting to think that she is going to heaven. This would reduce the stress on the individuals that loved her and would probably play a role in prolonging their lives. Likewise, the sense of community from gathering in a building and praying and/or singing releases beneficial brain chemicals, such as endorphins, and contributes to personal health and well-being, as well as the overall health of the community (lessened tension and conflicts, etc.).
On the flip side (riffing on a point another OP made which quickly got drowned in noise), beliefs impact scientific discovery, usually negatively; generations of peasants spent all their free time building cathedrals (rather than houses, schools, etc.), religious schools spend a good percentage of their time in religious indoctrination (the effect of the school I went to was that we were all behind by one year when we entered a secular high school), and most troubling of all, countless people have been made to feel shame or guilt when there was no reason to–and let’s not forget all the people who have been killed for “blasphemy,” the rivers of blood from religious wars (still going on today), and other casualties of faith.
(I don’t think we’ll hear anybody seriously floating the contention that praying to one’s particular deity results in better life outcomes; that is a logical non-starter, simply if you look at results: believers and unbelievers die at equal rates.)
The question hasn’t been empirically tested yet because so far, there haven’t been any non-religious societies (of any significance) in human history. The first examples may be coming to light, in Western Europe where a majority of people, in polls, deny having any religious beliefs at all. So we can’t really say either that “religion has helped mankind thrive” or “religion has held mankind back and contributed to human misery” with any degree of certainty. Therefore, I’m asking for your opinions, NOT on whether various and sundry deities exist, etc. etc. but on whether religion benefits or harms human society.