One reason could be - in poor/developing countries STEM is understood as the escape path from the poverty, while in developed countries people seem assured in their future even if they go in humanities or any other non-tech field - thus following their interests/hobbies rather than the need. EDIT: unintentional tl;dr as it seems :)
> “Countries with the highest gender equality tend to be welfare states,”
> they write, “with a high level of social security.” Meanwhile, less
> gender-equal countries tend to also have less social support for people
> who, for example, find themselves unemployed. Thus, the authors
> suggest, girls in those countries might be more inclined to choose stem
> professions, since they offer a more certain financial future than,
> say, painting or writing.