FWIW.. my own opinion. Feel free to disagree.
Basically some people are more naturally suited to being coders than others. The prime group is typically something like INTJ on the Myers-Briggs scale.
However the male:female ratio in that category is (IIRC) something like 3:1.
And that's why there will likely always be more male programmers than female.
It's like demanding that every ballet company has a 50:50 male:female ratio. Or nursery school teachers, as suggested above. Nature doesn't work that way.