This lecture by professor Paul Bloom of Yale starts with the observation that religion serves no obvious adaptive purpose.Naked Capitalism
Does Religion Serve a Purpose?
David Sloan Wilson disagrees:
One of the great intellectual battles of modern times is between evolution and religion. Until now, they have been considered completely irreconcilable theories of origin and existence. David Sloan Wilson's Darwin's Cathedral takes the radical step of joining the two, in the process proposing an evolutionary theory of religion that shakes both evolutionary biology and social theory at their foundations.David Sloan Wilson, Darwin's Cathedral: Evolution, Religion, and the Nature of Society
The key, argues Wilson, is to think of society as an organism, an old idea that has received new life based on recent developments in evolutionary biology. If society is an organism, can we then think of morality and religion as biologically and culturally evolved adaptations that enable human groups to function as single units rather than mere collections of individuals? Wilson brings a variety of evidence to bear on this question, from both the biological and social sciences. From Calvinism in sixteenth-century Geneva to Balinese water temples, from hunter-gatherer societies to urban America, Wilson demonstrates how religions have enabled people to achieve by collective action what they never could do alone. He also includes a chapter considering forgiveness from an evolutionary perspective and concludes by discussing how all social organizations, including science, could benefit by incorporating elements of religion.
Religious believers often compare their communities to single organisms and even to insect colonies. Astoundingly, Wilson shows that they might be literally correct. Intended for any educated reader, Darwin's Cathedral will change forever the way we view the relations among evolution, religion, and human society.— Publisher's description
The primary purpose of religion in an evolutionary sense is as a carrier of core spirituality, which lies at the core of all religions and wisdom traditions, and resides in all as evolutionary potential. This process of self-unfolding is elaborated by Meher Baba in God Speaks Part 1 and Part 2. The short account is here.