I would bet that if tight speedos came back into fashion there would be a rule against boys wearing those.
There's definitely an element of society telling women and girls what to do with their bodies. But, there's also an element of women/girls wanting to wear very revealing clothing, and boys/men wanting to wear less revealing clothing. Male swimwear is mostly shorts these days, at least in North America, for women it's a lot more revealing. Male office wear is suits, or at least button down shirts that are buttoned to the top. For women it's often a top with cleavage or at least upper chest showing, even in businesswear. A woman who wears a male-style shirt that covers up everything below the neck is pretty unusual. Then there's the legs. A woman wearing a skirt is seen as completely normal in a "business wear" office, but a man wearing shorts is most definitely not.