It's not a matter of law.
It's voluntary self-segregation.
There is no law against entering the wrong restroom.
Some extra-paranoid moms continue to bring their sons into the women's restroom until the kids are practically old enough to shave. Nobody cares.
If the matter were brought before the SC, it would be ruled unconstitutional to forbid someone access to a public restroom on the basis of their sex.
But since there is no law against entering and using any public restroom you wish, and the segregation is entirely voluntary, there's nothing to rule on.