Historically, men have dominated math, and some studies even showed males outperforming females on tasks of spatial abilities, including mental rotation, navigating spaces, etc. However, recent research suggests that the differences observed between boys and girls seem to be due to environmental factors. Gender stereotypes influence the likelihood of teachers and parents to encourage and train girls in math. Another factor is stereotype threat: women who think about their gender during a math task perform poorly, because “activating” their identity as a woman also activates the associated stereotype (“women are bad at math”). In one study, women performed better on a math test in a room full of other women, rather than in a room with more men than women. This evidence indicates boys and girls aren’t wired differently when it comes to math, and are affected by the social norms and stereotypes about their performance rather than their inherent ability.
See a scientific review of gender and intellectual abilities here.