That's the title of this very interesting paper by Scott E. Carrell, Marianne E. Page, James E. West. Here's the abstract:
Why aren't there more women in science? Female college students are currently 37 percent less likely than males to obtain a bachelor's degree in science, technology, engineering, and math (STEM), and comprise only 25 percent of the STEM workforce. This paper begins to shed light on this issue by exploiting a unique dataset of college students who have been randomly assigned to professors over a wide variety of mandatory standardized courses. We focus on the role of professor gender. Our results suggest that while professor gender has little impact on male students, it has a powerful effect on female students' performance in math and science classes, their likelihood of taking future math and science courses, and their likelihood of graduating with a STEM degree. The estimates are largest for female students with very strong math skills, who are arguably the students who are most suited to careers in science. Indeed, the gender gap in course grades and STEM majors is eradicated when high performing female students' introductory math and science classes are taught by female professors. In contrast, the gender of humanities professors has only minimal impact on student outcomes. We believe that these results are indicative of important environmental influences at work.