In Expelled, Richard Dawkins recounts how learning about science "killed off" his faith. And PZ Myers tells us that the more science literacy we have in society, the less religion we will have, and the more science, resulting in a nice feedback loop.

Their comments reflect conventional wisdom among atheists that the more you learn about science, the less religious you will become. In fact, it's the working assumption as to why in comparison to the American public, scientists are less likely to be religious.

But as I have mentioned in several comment threads, it turns out that the linear assumption that an advanced education in science burns away religious belief does not stand up to the data as published in the available peer-reviewed literature. I refer to this fallacy as the "atheists' delusion."
Scientists are human and products of society, just like everyone else. Rather than higher education impacting their belief, the data show that individuals raised in less religious families are more likely to self-select themselves into a PhD program and a scientific career. It's a complex socialization process that begins in the early years of family life rather than some simple knowledge-driven linear process that occurs during college or graduate school.

Here's what the most comprehensive study to date on the topic concludes, based on a survey of university scientists across a diversity of fields. From the University at Buffalo news release with the study here.

"Our study data do not strongly support the idea that scientists simply drop their religious identities upon professional training, due to an inherent conflict between science and faith, or to institutional pressure to conform," Ecklund says.

"It is important to understand this," she adds, "because we face religio-scientific controversies over stem-cell research and evolution, for instance, and increased debate about the role of religion in both national politics and in the public policies that influence science...

....For comparison with the general population, in the Social Problems article Ecklund and Scheitle employed data from the 1998 and 2004 rounds of the General Social Survey (GSS), a national survey by the National Opinion Research Center at the University of Chicago, which regularly collects data on demographic characteristics and attitudes of U.S. residents.

The RAAS survey asked questions on religious identity, belief and practice, which were replicated from the GSS, and other questions on spiritual practices, ethics and the intersection of religion and science in the respondent's discipline, some of which were replicated from other national surveys. In addition there was a series of inquiries about academic rank, publications and demographic information.

The authors then examined how natural and social scientists differ from the general public and how they differ from one another in terms of religiosity. They also considered some of the sources of these differences.

They concluded that academics in the natural and social sciences at elite research universities are significantly less religious than the general population. Almost 52 percent of scientists surveyed identified themselves as having no current religious affiliation compared with only 14 percent of the general population.

And while nearly 14 percent of the U.S. population who responded to the GSS describe themselves as "evangelical" or "fundamentalist," less than 2 percent of the RAAS population identifies with either label.

The only traditional religious identity category where the RAAS population has a much higher proportion of religious adherents than the general population is among those who identify as Jewish -- 15 percent compared to 2 percent of the general population.

Among scientists, as in the general population, being raised in a home in which religion and religious practice were valued is the most important predictor of present religiosity among the subjects.

Ecklund and Scheitle concluded that the assumption that becoming a scientist necessarily leads to loss of religion is untenable.

Ecklund says, "It appears that those from non-religious backgrounds disproportionately self-select into scientific professions. This may reflect the fact that there is tension between the religious tenets of some groups and the theories and methods of particular sciences and it contributes to the large number of non-religious scientists."
...

...The oft-discussed distinction between natural and social scientists with regard to religious belief is inconsistent and weak, Ecklund says.

"This is interesting," she adds, "because most of the scholarly literature on faculty attitudes toward religiosity addresses the field-specific differences between natural and social scientists and many scholars hold that social scientists are significantly less religious than natural scientists."

Results from the study also show that the more children in a scientist's household, the more likely he or she is to adhere to a religion.