Actually, they don't flock to it because they would prefer not to have to put up with the sexism so prevalent in much of computer science/IT these days. Having been the only woman in a CS class, I can assure you that it's not fun. It gets even less fun when the teacher firmly believes that you cannot be a good programmer because of your gender. It doesn't help that many women do not feel safe in the computer lab at night.
If you think that tech is a meritocracy, you're not paying attention. If you think everyone has the same opportunities, and the same encouragement you do, you're not paying attention. If you think that there isn't discrimination against women, you're not paying attention.
But here is the interesting thing. In places where there are enough women, as a percentage, these things are not as problematic. And that is why encouraging women to enter the profession is a very good idea, and a self-reinforcing.