I mean...did they not know about bed pans and such? Or outhouses? I always just assumed they might have had the same need for plumbing as us muggles have. Perhaps a more magic based plumbing system though. Even Elder Scrolls has plumbing, and it was brought up the romans had running water.
I suppose in some ways, muggles are more creative than wizards. They need to be, since they can't just magic things away. I always just figured being sanitary was an obvious thing, even to wizards.