As a foreign national living in US. It amazes me that public urination could land you in jail (specifically indecent exposure) however being naked in a locker room is supposed to be considered normal.
Even if it's a publicly-funded establishment such as, say, a municipal swimming pool, the conscious choice to enter into such a place versus walking through an open street aren't comparable.