Back when, pool filters were pretty basic; they used sand to run the water through. The way the filters were built, fiber, especially from natural materials, would collect in the interstices between the sand grains. There, they could develop quite vigorous colonies of microorganisms, many of which just weren't healthy for human skin, eyes, and ears.
What about chlorine, you ask? Keeping it high enough to kill all that crap was also not good for human skin, etc. Besides, when it killed the stuff, that stuff was still in place, clogging the sand... and ready to feed more bugs in turn, if the chlorine wavered. But even if nothing grew there, the filters clogged, and did a poor job, and weren't easy to flush out.
In short, wearing clothes in the pool was a quick route to either chlorine counts high enough to drive people away, or disease.
This didn't depend on anyone using the pool being infected to set off; the fiber collected the dead skin cells and body oils we shed in vigorous activity, and that material inevitably housed all sorts of bacteria that could put people in the hospital if they thrived.
So the reason was indeed hygiene -- but it was to protect the swimmer from the pool more than the pool from the swimmer.
That's the sort of thing you learn when you're going to be head lifeguard at a public pool, with responsibility for pool chemistry, filters, and pumps.
Today's filters, commonly using diatomaceous earth, can be easily flushed, and are componentized so filter baffles with a problem can be easily removed and replaced.
My dad still doesn't believe that --; he says that swimsuits were a conspiracy by neo-Puritan clothing industrialists intent on expanding their sales.
And people wondered why the Village People chose to do a song about the YMCA.
The kids and adults swam naked almost exclusively not too far back in the past before that.
Of course back then adults looked after kids, even those that weren’t there own, and nearly all kids had 2 parents, and the ones that didn’t those around looked out for all the more.
That, and the fact you got caught doing that stuff, people didn’t go to the cops over it, you just quietly disappeared.
The Y I swim at simply chlorinates the pool to any extremely high level, making nude swimming unnecessary.
Here is a website that is trying to change America back to the old way of thinking. These men might not have any susses, but they are on the right track of thinking.