It's like their version of the nostalgic College movie. Like, if Ferris Bueller was an entire genre, except deliberately avoiding the parts that are conscious about the existential qualms and unhappy notions of people drifting apart, life not working out, feeling unloved, and lacking purpose and courage.
High school in Japan is that one "Last Hurrah" of fun and romance before you sell your life to a corporation and run the very real risk of working yourself to death or finding your way down to loneliness, porn addiction, and eventually suicide valley as your social life dies outside of immediate occupational contacts and close family members and, weird Population Sink shit is going down and making everyone depressed, angsty, and hard to maintain a healthy relationship with.
Basically High School is the last compendium of good memories that the most avidly video-game-playing, anime-consuming adults in Japan fucking have, and the market taps into their untended, and in some cases untendable needs for affection and unjaded cheerfulness to keep the rising antisocial populace from killing themselves and leaving important jobs unfilled. Well, not explicitly for that reason. Corporations and media producers usually just do it because there's such an eager audience for it, between cringe-seekers and genuinely sad, lonely people. And also the folks who just watch it for the plot, of course.