1) Because the whole show is a parody of not just Trek but scifi tropes and the communal shower is one of the big ones.If attitudes are essentially as varied as today, why even have communal showers on the U.S.S. Cerritos (and presumably others)?
2) Because the show is really pushing the lower decks gets shit resources and living conditions angle by having them all sleep together in the corridors instead of their own quarters, or even a shared barracks like on the 2293 Excelsior.
3) Because Roddenberry was a giant horndog and "Gene's Vision" would most definitely include some boobies with his morning shower.
4) Because no one is denying that people in the Federation and beyond generally have a less uptight attitude towards nudity and fewer sexual taboos than modern people would, but your characterization of it as some kind of "inconsistency" or "mess" that individuals and cultures still exist that don't care for public nudity is an overreach.