Well there are religions everywhere, in man’s history, now as much as in the past. They all seem very alike; the worship of something, or someone through doctrines and rules, in exchange for guidance, security and eternal rewards.
The deities or otherwise worshiped ideas are given justification through actions, such as churches, prayers, sacrifice, what have you. Soooo if they’re everywhere and all seem to be the same thing, and have been for centuries, my guess is that they do, indeed, have a purpose, and are probably part of man’s survival, as ironic as this may sound. :/
People grouping together in the face of adversity and changing their fears into something else through religion. Religion has built communities, made people come together and created whole societies in the past. People need to be happy and secure to prosper in any which way I think, and religion helps with this. But the Chinese are the only people who are right about anything, because they believe in balance; Christianity in the middle ages pretty much made mankind stagnate for centuries, as no technological advancement was made anywhere for a long time, like until the Renaissance.
So while I don’t know exactly what the purpose of religion is, I am convinced there must be one, because other than war, which is also connected TO religion most times, it’s the one thing that keeps coming back all the time when we look at mankind’s history. I think it’s only in the last 200 years that religion is starting to lose its place when it comes to why people do shit. Whatever purpose it used to have may be done in some parts of the world, as science and technology become more and more important, and vital, to our modern lives.
But say some big thing happens and destroys everything, like a meteor or a meteor shower or something, and there are only a few survivors left on Earth who must scrounge to survive, there will eventually, I would have no doubt, be another religion.