There are all sorts of sexual fetishes and fantasies that have their route in early childhood experiences which are associated with sexual awakening. School uniforms is just one.
That is separate from the general fascination with youth in our culture (which is at least partly biologically-driven), and from the sexist set-up we have developed where some men, whatever their age, feel entitled to sexually harass and dominate all women, including less confident teenage girls.
All these factors drive the enduring appeal of the school uniform. It is only emphasised about girls rather than boys because the other way round wouldn't fit the way we structure what is an acceptable version of female sexuality. Most fetishes aren't.
The quirks that women are 'allowed' to bond over fit the dominant cultural narrative, like needing protection, hence fancying firefighters etc. Likewise, men get channelled into fantasies of sub figures like schoolgirls, or nurturers such as nurses.
That's not the whole story, because it's a complicated subject, but it explains a lot of it.