In his book "The Righteous Mind" Jonathan Haidt proposes that religion served - and continues to serve an important role in bringing about cohesion within non-kin groups.
To put it very briefly Haidt advocates a form of group selection but only insofar as it applies to humans. Our unique brains have made it possible for us to cooperate in groups in ways that are impossible for all non-human species. Despite their intelligence you will never see two chimps helping each other to carry the same log or one chimp pulling down a branch while the other removes the fruit.
His description is that humans are 90% chimp and 10% bee. We have a "hive switch" that can be activated by group activities giving us a sense of belonging and common purpose.
He agrees with other researchers that religion and supernatural belief evolved as a by-product of a hypersensitive "agency detector". In other words our ancestors did well to assume random events were a result of purposeful minds. But he then goes one step further and proposes that religions are sets of cultural innovations that make groups more cohesive and cooperative. Groups that were able to put their gods to good use outperformed those who failed to do so. Groups with less effective religions didn't necessarily get wiped out they often just adopted the more effective variations.
This form of group selection is not opposed to the model of selfish gene. Individuals who possess genes that lead them to groupishness increase their chance of survival and successful mating.
So according to Haidt religion is not a meme or a parasite of the mind but a vital development in cultural evolution.
That is a very brief synopsis of Haidt's argument but even as somebody who has been very much influenced by Dawkins, Dennett and Harris I admit I find the idea interesting. I will add some more details of Haidt's evidence later.