The first sex-segregated toilets were assembled in a Parisian restaurant for a ball held in 1739. Preceding this, public restrooms were unmarked or marked for men only. The need to establish sex-segregated bathrooms in the United States arose from a
lack of women's restrooms in workplaces (toilets had been for men's use only). In 1887, Massachusetts became the first state in the United States to pass legislation requiring that any workplace with female employees to have a female-specific restroom. By the 1920s, most states had passed laws regarding sex-segregated bathrooms.
American public restrooms are regulated by two separate federal agencies. The U.S.
Department of Labor governs workplace restrooms while non-workplace restrooms are governed by the Department of Health and Human Services. Many places in the United States are "legally prohibited from offering only restrooms for men." Mary Anne Case points out "Even in public spaces, such as restaurants, where two single occupancy, self enclosed toilet facilities are all that is provided to customers, signs designate one 'Stallions' and the other 'Fillies,' one 'Pointers' and the other 'Setters,' or, more prosaically, one 'Ladies' and the other 'Gents.'" These regulations are mostly based on the precedent created by original legislation, though they sometimes also work to eliminate the longer wait time females often face by creating a ratio of more female restrooms than male restrooms.
Building codes are another reason that urinary segregation continues, because buildings from different eras are subject to different codes. In many situations, building owners do not update existing features because it allows them to continue following the older building codes that go along with those older features.