I've been thinking about this a lot recently, and I think whether someone learns programming is intrinsically tied to wanting to figure out "the rules". For as long as I've been alive, I've noticed that whenever I've looked at some system it was clear that it operated according to some rules that were understandable. And understanding those rules was its own reward, but it also enables more effective or efficient usage. Programming (and mathematics and physics and chemistry and...) is just learning the rules of computers (or their respective fields). We're so eager to find the rules to every system that it gets us into trouble with systems (like people) that don't have inviolate rules.
In my observation, women (as a class) are more likely than men (as a class) to discount understanding those kinds of rules, because they're useless for interacting with people - and women tend to be more people-oriented than men. It's not for anybody to say whether this is better or worse, I think it's just that there are many different kinds of people, and that they consider different things important.
As another observation, I know a lot of really great female programmers and scientists, and they all see the world broadly as I do - as something to be understood, with rules that are worth discovering. And I know many men who see the world as full of things that just happen, and the reason isn't as important or relevant as the consequences to them and the people they care about. But of the latter type, I know more women than men, and of the former, more men than women - so assuming that the former type are more likely to program (arguably the most rigorous and least-nuanced system), it's not surprising to me that more men are programmers.
Still, I'm offended by this notion that women constantly need cajoling and reassurance to do pretty much anything. Every woman I know is perfectly happy to decide to do something, or not, and they're not stupid or uninformed or incapable of deciding for themselves what they want to do or not do. If the goal is equal treatment, why do we seem to consider women as less capable of deciding their interests than men? A lot of women are behind this, but that doesn't mean it's not sexism.
I think we really need to separate access and opportunity from results. The former is the important one, though admittedly hard to measure. But emphasizing for percentages leads to some really peverse outcomes. Just as an example, I went to university with several top-notch female coders - and each one had to spend a lot of effort both throughout university and when they entered industry that they weren't there to fill some admissions or HR quota. It's ridiculous, of course, as they were top-notch - but quotas, implicit or explicit, by definition lower the bar from "as competent as possible" to "as competent as possible, while meeting the quota" , so the only logical conclusion is that the average within the quota is lower than the average outside it (otherwise they wouldn't need a quota). It's really messed up that we've made what should be labeled sexist thinking, into a reasonable conclusion - all in the name of giving a leg up to minorities!