What's the Evolutionary Purpose of Religion?
In terms of genetic evolution, religion itself cannot really be considered to have an evolutionary advantage or disadvantage, as it is not anchored in any genes. This means that it is not an evolutionary trait and hence the principles of evolution do not apply to it. However, religion is a product of underlying capabilities of the brain (for example imaginative capacity?), and these are genetic and evolutionarily advantageous. Aside from this, asking for the 'evolutionary purpose' of anything is the wrong way to approach the topic, as things do not evolve to have a purpose but they simply evolve and stick around unless they produce a net disadvantage compared to a competing version of the same trait.

You could look at religion from a memetic point of view however, i.e. as an idea which competes with other ideas. The idea of religion has many aspects to it that would help it to 'survive', i.e. not be forgotten. These include the drive to tell other people about it, ease of understanding, the claim of exclusivity, addressing many social cravings, and filling in gaps of knowledge for which explanations are desired.