Quartz has an interesting interview with Stanford labor economist Myra Strober.

[Quartz:] Research shows that when women enter traditionally male fields, the pay for that field can sometimes decrease. Why is this?

[Strober:] I’ve studied this topic in detail, looking particularly at elementary school teachers and bank tellers, and I have concluded that what starts an occupation’s change in its gender designation is not that women move in, but that men move out. When some other occupation that requires the same level of education becomes relatively more attractive to men, they move out of the less attractive occupation and into the more attractive one. Men move out of an occupation because its attractiveness in terms of pay, working conditions, and promotion possibilities are declining. Once men move out, women begin to move in, and then the pay and promotion opportunities decline still further.

In the 1930s and 1940s, bank telling was an attractive occupation for high-school graduates. Then came World War II and as men left to serve, women came in as bank tellers. After the war, employers tried to hire men as bank tellers, but men who went to the armed forces now could go to college free of charge. After college, the men no longer were hired as bank tellers. If they went into banking, they went in at a much higher level. Eventually, bank telling was feminized, and by the 1960s and ’70s, working as a bank teller paid less than the average salary for high-school graduates.

Likewise, computer programming initially was women’s work. But as it grew and became attractive, men moved into it and employers began hiring men as computer programmers. Women went elsewhere.

Now, the question is: Why do employers hire men into the more attractive occupations? Why do they essentially give men first choice of occupations?

Source: Don’t ask women why they should earn more–demand that managers justify paying them less — Quartz