IMHO Religious thoughts in humans began as a reaction to a hostile and frightening environment and must have had some survival value (e.g. overcoming the fear of death and thus being able to face a world that was going to kill you, one way or another, whatever you did).
Is there any point to retaining these vestiges of primeval rationalisation now tho?
And without meaning to cause offence to anyone more spiritual than me, but I personally believe that religion has become a sort of mass-hysteric mental illness over the millenia. Please note I don't use 'mental illness' in this context as a jibe or denigration; I suffer from anxiety, depression and OCD myself.
Just as we host many bacteria and viruses, some of which can become harmful, and 'broken' DNA that can cause disease but may have other positive effects, maybe religion is just another 'cross to bear' that comes with benefits for humanity? A symbiotic meme that continuously replicates and will always be with us...
...or will evolution condemn it to the dark ages (tho it shows no sign of happening so far, even (or especially) in ostensibly 'atheist' (ex-) communist countries)...?