The popular view that scientists tend to be politically liberal has, despite the many counter examples, a pretty good basis in fact, at least as a trend. I don't want to give the impression that I have no conservative colleagues (I have several) or that these people are ostracized (they aren't), but simply that they are in the minority. None of them perhaps would pass a Republican purity test, but they certainly wouldn't pass the Democratic purity test either.
One could easily suggest several possible reasons for left-lean. The liberal might say that scientists are people trained to think carefully about ideas, and liberal ideas stand up to careful thought better than their conservative counterparts. She could add that conservatives, particularly the United States, tend to engage in a great deal of anti-intellectualism, which is not a good way to win the support of scientists and that conservative leaders and movements twist scientific conclusions and ideas more frequently and more disastrously than do liberals. A conservative could argue that as a big-spending liberals tend to support science funding, scientists have a direct interest in supporting liberals. I think all of these things are at least sometimes true.
Another hypothesis occurred to me last night during our Halloween party. Looking around our apartment, I saw not only several Americans (tiger, mime, fisherman, pirate, little girl/trick-or-treater, scarecrow, frog, Dorothy, lumberjack, but no tricorn hats) and Germans (lizard, clown, flapper, schoolgirl, bus stop, Little-Red-Riding-Hood, ninja, and a little boy dressed as a little boy), but also friends from Italy (a mouse and a mummy), Hungary (bank robber), Austria (ghost and witch), Australia (tin man and geisha), Poland (burglar, witches and a ghost), Latvia (witch), Spain (ghost and sorceress) and Finland (clown, penguin, bear and ladybug). We had 34 people from 10 countries, and had invited people from at least a dozen more (Japan, Taiwan, China, Mexico, Brazil, the Netherlands, Denmark, England, Russia, Bulgaria, Turkey and New Zealand). This sort of national diversity is common at gatherings of Institute researchers. I had a similar experience at Berkeley, with colleagues from all over the world.
Conservatives in many countries are nationalistic, or at least view the traditional ways of doing things in their part of the world as best and most correct. So perhaps the conservative hoping to build a career in science finds herself in many uncomfortably international situations, where her assumptions are challenged or potententally unpopular. If so, such people may tend to either revise their opinions (or pretend to, which often eventually leads to an actual change) or avoid such situations. Such avoidance would make a successful career in science difficult, at least at the prestigious institutions which tend to have international research staff.
The Ivory Tower's relative lack of political diversity may partly result from its high demographic diversity. It is hard to condemn witches when your living room is full of them.