I suspect that the increase in Mary Sue characters in media is the result of a perfect storm of females lacking the understanding of what it means to struggle in order to earn (what men regularly experience) as well as a major lack of pushback in today's academic and corporate world.
Thus, we get story telling about female characters who are always just so amazing at everything and the only "conflict" they have is the Patriarchy holding them back from being awesome.
This makes both the storytelling and the characters bad. There is no real challenges for Mary Sue because she can do everything effortlessly. She just has to realize it and tell all the naysayers that they are wrong and she is great.
This makes for a boring story and is really getting tiresome (e.g. Captain Marvel, Star Wars 7-9). Stories are better when the character has real struggles to overcome.
The most recent factor in all of this is the overall lack of pushback. When these story ideas are not properly challenged, it does not allow for much real refinement.
This lack of pushback only serves to embolden the egos of these women in storytelling media. Only when money is lost from these bad ideas do they finally see consequences from their failure.