I think that the line of thought goes something like:
* There's a variance between the number of men and women in field X.
* This gap does not correlate with the number of men and women in the general population.
* Therefore field X must be discouraging women from going into the field that would otherwise be interested in the field.
I believe the thinking is that if everyone did what they wanted to do, then the gender balance in any random field would probably be relatively close to the gender balance of the general populace.
As an aside, it's not like men are actively encouraged to become programmers by their social peers. There are a small group of men who program and support each other in that vein, in the general population it doesn't exactly represent the hopes and dreams of parents of male children. (Eg. Mom and Dad statistically would encourage becoming a lawyer or doctor much more than a programmer).
I think as a society we should encourage women and men to do what they want rather than that they should fill some predefined gap that we think needs filling. I could care less about the gender gap in computing or the gender gap in nursing.