An interesting post at "Magic Statistics":
Toward a sociology of atheism
The most common efforts toward a sociology of atheism attempt are versions of secularization theory. Secularization theory tries to correlate the rise of atheism in society with a feature like education, economic prosperity, etc. The chief problem with just about every secularization theory is that it fails to account for the United States, which on secularization theories generally turns out to be a massive and unintelligible anomaly. (Nor, it should be said, is the United States always the only problem. The United Kingdom, for instance, which is much more secular than the U.S., nonetheless is still more religious than one would expect on most versions of the secularization theory, which often have difficulty explaining why the U.K. is more religious than, say, Germany or France. Ditto with Canada. But the big one, and the ultimate rock on which secularization theories tend to break, is the U.S., which is in a category all of its own.) In the post above, Scott Gilbreath points to an alternative to secularization theory that I hadn't heard of before, namely, compensator theory. The idea is that religion functions socially as a set of compensators: compensators are "postulations of reward according to explanations that are not readily susceptible to unambiguous evaluation" and supernatural explanations are among the most general compensators, i.e., they compensate for a wide variety of different rewards, and to a very high degree (think of Pascal's Wager). In the absence of a desired reward, people tend to accept explanations that posit a way for that reward to be fulfilled. Now, since compensators are explanations that give hope of rewards that are deferred or abstracted from immediate practical considerations, people naturally have a tendency to prefer immediate rewards to compensators. Compensators play an important role in social function, because they give a means for us to give aid to another even when we are not physically or financially able to do so. One thinks of prayer in this sort of situation -- someone unable to provide help to another may nonetheless offer to pray for them; belief that the prayer is doing some good, or that the prayer may be taken as a sort of genuine assistance, is a compensator. A dying man may prefer an immediate cure; but failing that, may very well be heartened at the fact that someone else is praying for him. Compensators also play an important role in psychological functioning. A parent worried about her lost child may well pray for the child's safety as well as look for the child; the prayer is a powerful compensator for the fact that the parent can't immediately produce the child at will. Such a compensator might (e.g.) help the parent avoid despair long enough to find the child and keep him safe. Compensators play a role in all our lives; and religion provides a set of compensators that are very broad in scope.
On a compensator theory of the rise of atheism, atheism will tend to arise in situations where people don't feel any need for compensators: that is, among people who are prosperous, have most of their needs taken care of, and have relatively few social obligations. In such a case there is relatively little practical use for compensators: even on the supposition that theism is true, for instance, a successful single man with no strong family ties in a developed country with a good welfare system and a relatively safe environment has very little in his immediate, practical, daily life that would require compensators as broad as theism potentially provides. Most of his practical needs are relatively easily fulfilled; and thus religion isn't as salient a factor for ordinary life. It's an interesting alternative. (I seem to remember that Freud somewhere has a very crude version of this, but I might be misremembering.) How well it accounts for the facts is a tricky issue, as Gilbreath points out. But it's a matter of some interest.
UPDATE: Miriam in the comments points to Callum Brown's The Death of Christian Britain as another proposed alternative to standard secularization theory. Brown's thesis is apparently that Christianity in Britain began to collapse in the 1960s due to a shift in women's sensibilities; since women were a major mainstay of British Christianity, and they were no longer finding it a useful way of seeing the world, the whole thing collapsed.