A. When they have kids.
...researchers [Sociologists Elaine Ecklund (Rice University) and Kristen Lee (University of Buffalo, SUNY)] found that agnostics attend religious services (e.g., church) at about the same rate regardless of whether they have any children. By contrast, the attendance rate of atheists with children jumps 70% compared to those without. Children constitute a statistically significant factor in atheists attending religious services and joining religious communities. It should be noted that the atheists and agnostics in this study are all top-tier scientists, so these findings may not hold for atheists in general.
But why would atheists go to church? I mean, what's that all about?
First, scientists feel that having a scientific mindset means being able to make choices for oneself. Even if the scientist parent does not believe in God, this does not mean that the parent should impose that decision on his or her children—the children should think for themselves. Many scientists interviewed explicitly stated that they did not want to indoctrinate their children into atheism and so exposed their children to a diversity of religious communities.
Second – the most dominant reason – many of the scientists had a religious spouse who had a strong influence on how to raise their children. While this naturally required some negotiation, most of the scientists came from religious upbringings themselves and did not oppose a religious upbringing for their children.
In many circumstances they favored a religious upbringing because, third, they believed it would provide children with moral orientation. One scientist, who does not have children, said he would raise his children in the Catholic Church because he was raised Catholic and believes Catholicism teaches children important values.
Finally, atheist scientists raise their children in a religious setting because of the community it provides. Religious communities have a strong moral outlook and allow for intimate relationships.
I don't buy the first reason. I think it's cover. And the last three reasons seem more like one big reason -- church is good for moral development and family peace. But there's probably another reason, harder to quantify:
People want to believe. Even scientists and atheists. Maybe especially scientists and atheists.