Why we do what we do.
My blog posts on religion have attracted a lot of controversy. Religious people are annoyed by my claim that belief in God will go the way of horse transportation, and for much the same reason, specifically an improved standard of living.
The view that religious belief will give way to atheism is known as the secularization thesis. The specific version that I have described is known as the existential security hypothesis. The basic idea is that as people become more affluent, they are less worried about lacking for basic necessities, or dying early from violence or disease. In other words, they are secure in their own existence. They do not feel the need to appeal to supernatural entities to calm their fears and insecurities.
The notion that good living conditions are associated with a decline in religious belief, importance of religion, church attendance, and so forth, is supported by a mountain of evidence assembled by Pippa Norris and Ronald Inglehart in their book, Sacred and Secular, as well as numerous more recent works.