Edit: if you want to down-vote this, go ahead, but please tell me which one of the facts I have written is incorrect. I also welcome opposing viewpoints with explanations. I am merely providing some of the reasons that men are hired above women. This does not necessarily represent my personal viewpoints, I am playing devils advocate in some cases here.

>The economist Larry Summers famously suggested once that so few women become scientists and engineers because of discrimination, preference and even differences in innate ability.

Ability? There are many teenage prodigies who become homeless and total failures in life. Who ever thought that ability alone guarantees anything? This is a flawed and narrow minded mentality.

Does anyone ever stop and think that there may be more logical reasons than ability that men are hired above women?

There are probably thousands of reasons that men get hired in front of women. Here are some (many of which are not politically correct) facts. As derived by science, statistics, and surveys. I am only echoing information based on research and experience (as a HR specialist for 15 years). These are generalities and certainly don't apply to all women and all men.

Women are generally less ambitious (even if they had better grades). Less creative problem solvers, and less logical (more emotional) with their decisions. Most of them lack the strong drive that men have for career advancement and success. Many men relentlessly work toward advancement and achievement despite having to make sacrifices such as family time, and other obstacles. Much of this is because of the role of testosterone and the design of the male brain (for competition and dominance). I am not saying that there are no women who are ambitions. I am just saying that the ratio is highly in favor of men here. I mentioned the testosterone part because many of you will respond that it is only that women have not been given the proper chance and thus the difference. This has been dis-proven by science and statistical studies.

Most women at some point get pregnant and have kids. This (moderately to severely depending on the person) affects their productivity and mood while pregnant (9 months). Afterward they are off work for 4-6 months (or potentially much longer if the newborn has health problems). The women cannot be legally replaced during this time. Her job has to be waiting there for her when (and if) she eventually comes back. When she does come back, women miss far more work than men to take care of sick kids. This all puts a company in a difficult position (financially and otherwise) that does not exist for men.

Women miss work more often than men because of personal illness and depression.

Women are far less amenable to overtime and don't perform well in crunch situations. They do not cope with stress as well as men, and emotionally degrade with fatigue at a far faster rate than males. When distressed, they become irritable, combative and irrational more often than men when in high stress situations (their emotions escalate more quickly).

Women's hormones fluctuate at a far higher rate and frequency, often affecting their moods, concentration, and productivity. Estrogen causes emotional instability and fluctuation. Men have little estrogen and don't experience the peaks and valleys that women do. Women are more likely to form clicks and ostracize, other women among other social problems. Women just don't get along with women quite often. It causes a real distraction for everyone and hurts workplace morale.

Women (attractive ones) are a distraction to many men. I am generally not blaming women for this, but it is a fact. Men will spend time talking to a pretty female employee just because. Workplace relationship that may form are often disastrous. When the relationship ends, a real mess ensues.

Men can and do occasionally (some men more than occasionally) talk dirty when women aren't around. You have a women around and men have to watch everything they say. They can't say t__s or b__bs out loud. That could land them in the unemployment line because of a sexual harassment complaint.

Men have been in charge since the beginning of time. They have leadership built into their DNA. They see women as trying to encroach on that and being the competitors that they are - don't want extra competition. This is natural.

Political correctness and "equality". Wither you are are for or against them, are not natural, logical or intuitive. Men thinking that men should be selected above women in tech/science because as a whole, they posses more natural skills and posses less natural challenges is logically the best bet. There are instances where a women will outperform a man, but statistically the odds are against this happening by a large scale.

Edit: here are a couple more statistics:
Women are more likely to quit a job.
Women are more likely to exit the workforce altogether.

There are a number of books rationalizing gender based wage and hiring inequality that point out far more statistics and logical (cause and effect) reasoning than I have mentioned here. I will try to dig up a couple.