Because in order to pee you have to expose your genitalia. I suppose the laws were made so that anyone exposing genitalia could be charged for it.
That being said, it is completely stupid that people are actually made to register as sex offenders when they really were just peeing. Doubly so when they did so without anyone other than themselves seeing their private parts.