One has to be careful in examining evidence to use caution drawing conclusions based on the evidence. It's very easy to think your data supports some hypothesis, while in reality the same data might support several hypotheses and more research will be needed to sort out the correct one.
What do we know? That the majority of the human population believes in some kind of deity(s).
What are all the possible hypotheses that might account for that result?
One hypothesis could be there is some sort of survival benefit leading to natural selection of the trait.
Another could be that there is a natural selection of group cooperation and religion is just one means of achieving group cooperation, but not an exclusive means nor a superior means.
I tend to favor the religion as a side effect hypothesis, myself. Our brains evolved with natural selection that favored cognitive organization that leads us to look for patterns, for cause and effect, and so on. That brain organization leads originally to belief in religious and superstitious explanations for the world around us. But over time, additional observations evolve into a scientific model of explaining the world.
Since the scientific process gives better results for surviving than religion and superstition, I would hypothesize that scientific thought will eventually be naturally selected over religion and superstition.