Sturgeon's Law states that 90% of everything is shit, and this absolutely applies to anime. The worst of the worst can be disgusting as hell, and I hate how often minors are sexualized.
That said, the good stuff is good! I can name a handful of high school romance anime/manga I've really enjoyed (Kaguya-sama: Love is War, Horimiya, You and I are Polar Opposites), and what these series have in common is that they're about romance, not sex. The characters aren't presented as sex objects for the audience to lust over, they're characters in a coming-of-age story, and the stories I just named are all kept wholesome and PG-13. I would honestly recommend watching these just to see if they change your opinion at all.
High school settings are popular because that's often the most pivotal turning point in a person's life - ideal for a coming-of-age story. For many people that's often when they had their most active social lives, and for a writer it's a pretty easy shortcut to giving the cast a reason to interact with each other.
And honestly, I think a large part of it also has to do with nostalgia for the audience. I'm sure you've heard the term 'loneliness epidemic' used a lot these days, high school settings can be appealing to those who lack much of a social circle today and maybe feel like their lives have all been downhill since then.
I don't doubt for a minute that a good number of people with waifu avatars probably want to fuck the anime schoolgirl. But I think that there are a lot more people who just wish they could be the anime schoolgirl.