In essence, it isn't just that Religion is beneficial to humans, but that Religion itself is an idea that self-replicates due to its nature.
Let's look at several reason why Religion is useful:
1. Unification- Priests practically rules Mesopotamia, and wars were justified much quicker if under the pretense that God wanted it. Also, Divine Right also helped Kings avoid rebellion.
2. Control under Unification- The idea of God is better than even the thought police because God is always watching and judging. Any ruler can simply show that if people do not follow certain ethical rules, they will go to hell. Unlike athiestic early civilizations, this enforcer was around 24/7, watching every individual like a hawk.
3. Control under Enforcement- How can a wise man take control of a band of brutes if the only rules is the toughest wins? How does a Priest benefit off of thousands of people without rebellion? Because there is no fear like the fear of eternal hell. I can think of no better way to control a civilization full of stronger and potentially smarter adversaries then to gain mental control over the populace's views of the after-life.
Now, here are some reasons why Religion replicates itself so easily and is so appealing:
1. Unanswered questions- With higher thought comes complex questioning. Man has always wondered where he came from. Remembering that Darwinism was not around, what would seem like the most likely explanation for the seemingly unexplainable events occuring (such as lightning)? Why of course, a higher power, a supernatural being(s) that can do anything. It answers the question quite easily.
2. Fear of the unknown- Mortality, death, is scary. Even today, there are many who would willingly disillusion themselves with the idea of an afterlife then face mortality. The afterlife is appealing because it is the opposite, immortality. While we no longer are living on earth, we are still living in heaven. You may say that we are then dead, but as long as our mind and "spirit" are intact, what is the difference between living in heaven and living on earth?
3. Lack of purpose- You'll usually find this in the stories of born-agains. Life has no purpose if we were simply created by chemicals. Isn't it easier to imagine that there we were given duties to perform? A goal?
4. Fear of lonliness- Almost universival among religion is the idea of a personal God, one who has some sort of relationship with the individual, whether it be loving, caring, or even amusement. The personal God is like a foster parent, a guardian always watching over you. What is a safer feeling than that?