I think religion provides certain functions that do no compete with science and when it attempts to be scientific it is simply superstition, but that is the typical way that the current run of science driven atheists see religion, as a kind of literalism that is mistaken.

It is more useful to see religion as a kind of art and functions, as all art, to round out our direct experience with imagination. It should be obvious we cannot live without art, not the museum art, but the sum total of our everyday mythmaking, the hope for peace, the consecration of values, the assumption that love can prevail, or that, even if you die in the seconds which life offers, there will be some saving grace; having done something good or useful, leaving virtue in our children, and so on. Who doesn't hope (hope itself going against the evidence) for a good outcome, who doesn't celebrate life once in a while. It's as thought the universe were, after all, a benign place, and even one's death is not a calamity.

Of course, some of the religious arts are puerile and stuperstitiously expressed, but this does not call for the end of religion because science has had successes, but it calls for new acts of the imagination in which we can, in spite of the unknown, carry on, in spite of the tragic vein in the ore of human existence.