Here's no surprise: beliefs that we imagine to be rational are bound up in all kinds of other stuff. Political stances, for example, correlate with various personality features. One major review in 2003 looked at 38 different studies, containing data on 20,000 participants, and found that overall, political conservatism was associated with things such as death anxiety, fear of threat and loss, intolerance of uncertainty, a lack of openness to experience, and a need for order, structure and closure.
Beliefs can also be modified by their immediate context. One study from 2004, for example, found that when you make people think about death ("please briefly describe the emotions that the thought of your own death arouses in you") they are more likely to endorse an essay discussing how brilliant George Bush was in his response to 9/11.
A new study looks at intelligent design, the more superficially palatable form of creationism, promoted by some religious groups, which claims that life is too complex to have arisen through evolution and natural selection. Intelligent design implies a reassuring universe, with a supernatural creator, and it turns out that if you make people think about death, they're less likely to approve of a Richard Dawkins essay, and more likely to rate intelligent design highly.
So that's settled: existential angst drives us into the hands of religion. Rather excellently, after all, the effect was partially reversed when people also read a Carl Sagan essay on how great it is to find meaning in the universe for yourself using science.