You're right and I think it helps to remember certain traits which make religion "fit" from an evolutionary perspective can be beneficial to its followers: believing that the most powerful being in the universe is on your side instills confidence and a sense of well-being. Having community members who believe that God has mandated they should help each other means people may receive assistance when they experience difficulty.
I would argue in the long term having beliefs which are more and more consistent with observed reality is more sustainable. The further your beliefs are from reality and the longer they're held the more likely something will go wrong. Still, if we (whoever that is) want to encourage people to move away from religion we should think about how we can replace the positive aspects of the religious experience.