If we made a poll for boys and girls from the age they learn to speak until 18 years old, and asked to rate 3 statements:
Math is important.
Money and getting a high paying job is important.
Having rich social life and a large family.
What will the gender differences be, and which will have a bigger extreme? Which will see an reinforced difference as the children grows older and into puberty, the time where career directions are usually made? Last, how does the economy of the country in which the children live influence the answers.
Here is a bet: Its all about the second question, for which math correlates to. Culture will influence children to strive for money if there is a risk to not have food on the table, roof over their head, and parents that will go without both at elderly days. This result in gender roles to merge on the subject of being the provider. "math is for boys" is identical to the idea that "beauty parlors are for girls"; inter-gender competition thats are effective strategies when other basic needs are fulfilled. Focusing on inter-gender competition while starving is a poor strategy. A collaborating evidence to that bet would be if women in countries with lower gender segregation in tech has a better chance in escaping poverty through math than marriage. It would then be maladaptive in those places to have stereotypical gender roles where men are the sole providers.