Atheists and secularists will always misunderstand religions, because they assume its purpose is to generate truth. When it fails to do so, or when it generate erronneous beliefs, the suppose that it has failed. But in fact, religions exist to generate heresies, and so long as they do that, and so long as heresy has consequences, they will flourish.
To make sense of this, we need to distinguish between religions and supernaturalism. The definitions of religion favoured by Pascal Boyer, Scott Atran, and the other theorists of religion as a spandrel make supernaturalism essential to it. But this is entirely to omit the role of doctrine. Doctrine, which is in some senses a technological phenomenon, since it depends on writing, fundamentally changes the relationship between the supernatural and society: it brings our private imagination into the public sphere. Joan of Arc could not have been condemned in a pre-literate society. Before the invention of doctrine, you can distinguish outsiders because they belong to a tribe. Perhaps you can distinguish them because they talk funny (the original meaning of ‘shibboleth’ is relevant here). But after it, you can have more in common with members of a wholly different tribe than of your own. Conversely, your own tribe can be deeply split. This allows for much more creative coalition-building.
What this says about the modern longing for ‘spirituality’ is another question, or another post, at least..
(also sparked by this discusson at Pharyngula)