Because people think STEM isn’t for girls. Research shows the jobs parents want their daughters to do are teacher, nurse, fashion designer and hairdresser. Engineer / scientist doesn’t even make it to the list. Even doctor is low on the list.
I agree with Agata, I think it is because of negative stereotyping by parents and teachers. I have worked with girls who can see the opportunities within engineering that are available to them, but have then been put off them by teachers and parents telling them that girls don’t do that sort of thing. It then becomes a vicious circle, as they then don’t do that sort of thing, so there are few role models for them to follow. Some of the best engineers I work with are female, the difference is that they stuck with their belief and studied engineering despite what other people told them.