It's because it used to be considered "womens work", similar to clerical work. Then companies did research and found that the best programmers were usually introverts, so they started advertising and pushing to get more men into the field because women tended to be more social, or would want to leave school/work to start a family. So it shifted and became "mens work", and women naturally assumed it wasn't for them because there weren't many people saying that anyone can do it.
https://www.bloomberg.com/news/features/2018-02-01/women-onc...