If religion is simply a hypothesis that's so full of holes it's absorbent! Why does it persist?
I think it's because people naturally think they are special. The instinct for self preservation is the mother of self importance without the feeling of self importance, there would be no self preservation. Being in possession of a rather large brain and evolving into the number one apex predator can make you a little smug too, but that large brain had only begun to scratch the surface when the big questions came up; what makes the sun hot, why is the sky blue in the day? and black with white dots at night?,why am I here?, where did I come from? and where do I go when I die? The large brain didn't even know that it was alone. None of the other brains could think the way it did. That big brain was special and it slowly began to wonder why; why was it at the top of the food chain, using tools that no others could fashion? The big brain went on to do wonderful things and archived greatness as it took over and claimed the world as it's own. It found nothing to explain where it came from in the natural world but, there was another world. The world of dreams, while the brain was at rest it seemed to enter a different realm, a spirit world not governed by any earthly limitations. The brain hypothesized that some unseen spirits were at work and started to use this catch-all to explain everything that it had no explanation for. The spirits got more and more sophisticated as time went on and evolved into gods. Great and powerful gods who watch over us and punish us when we are bad.
Old gods were abandoned as needed as the brains started to figure out how thing really worked and new gods took there places. New gods that better fit the times. New gods that better fit the new world views. But now we only have a few unanswered questions and they are the big ones; why am I here, where did I come from and where do I go when I die? In our egos we are the most important species on the planet. We seem to have been put in charge. We must be special! The brain thinks it is special and cannot fathom death to nothingness simply because it is alive and thinking. Therefore it clings to an the hope of an afterlife. There is no proof of an afterlife but, the brain needs to feel that it will go on because, it can never know any other condition.
All is not hopeless though; the brain is evolving and so are the gods. I think the gods will go extinct first.