Amid a debate over transgender rights, the arguments against gender-neutral restrooms are remarkably consistent with the Victorian notions that created sex-segregated facilities in the first place. Photograph by Adam Gault / Ocean / Corbis

In the middle of taking the bar exam at the Jacob K. Javits Convention Center, in New York City, along with thousands of aspiring lawyers, I had to go to the bathroom. The enormous line for the women’s restroom looked like it would take at least a half hour. There was no line for the men’s restroom. I walked in, passed my male counterparts at a row of urinals, used one of several empty stalls, then returned to my desk. I felt that my decision to forgo the women’s bathroom made a difference to my passing the exam, and that the much longer wait for women than men during an all-important test for entry to the legal profession was obviously unfair.

There is now, however, an active debate around what bathrooms we should be able to use. A recently proposed Indiana law would make it a crime for a person to enter a single-sex public restroom that does not match the person’s “biological gender,” defined in terms of chromosomes and sex at birth. The punishment could be up to a year in jail and a five-thousand-dollar fine. Similar laws proposed in several other states have not passed. These proposals attempt to counter recent moves in many states to allow transgender people to access bathrooms that correspond to their gender identity. In the wake of the Supreme Court’s same-sex-marriage decision, last summer, these skirmishes may give the sense of moving the L.G.B.T.-equality debate from the sublime to the ridiculous. But the implications of the controversy go far beyond bathrooms.

Last fall’s successful campaign in Houston to reject a broad anti-discrimination ordinance made clear that restrooms will be fields of battle over gender and sexuality for the foreseeable future. The Houston ordinance, which prohibited discrimination in employment and housing based on categories including sex, race, religion, and gender identity, was defeated in a referendum after opponents painted it as a “bathroom ordinance” that would enable men to enter women’s restrooms. One ad in the campaign showed a young girl being followed into a bathroom by an older man. Another ad emphasized the risk of having registered sex offenders in bathrooms with women and girls. The vulnerability that most people feel in a public restroom, with their trousers pulled down in proximity to others, was easily exploited in connection with sexual assault. Saying no to the so-called bathroom ordinance was framed as preventing sexual danger to women and girls (even though danger to transgender individuals is often seen as a reason to support bathroom access).

Today’s most-prominent arguments against inclusive restrooms are remarkably consistent with the Victorian notions that led to sex-segregated bathrooms in the first place. When the ideology of separate spheres for male and female, public and private, the market and the home reigned, the growth of women’s presence in public life led to the desire to protect women from the crude dangers of the male world. Among the legal effects was the 1873 Supreme Court holding in Bradwell v. Illinois that it was not unconstitutional for a state to deny women admission to the bar on the basis of their sex, with a famous concurring opinion that stated, “Man is, or should be, woman's protector and defender. The natural and proper timidity and delicacy which belongs to the female sex evidently unfits it for many of the occupations of civil life.” The same separate-spheres paternalism led to the designation of certain physical spaces for women apart from those for men, including bathrooms in public venues. These were safe spaces, if you will, tucked in a world in which women were vulnerable. As our society is currently experiencing a resurgence of paternalist concern about women’s sexual vulnerability—especially in the context of that great equalizer, education—it is no surprise that there would also be a new emphasis on the Victorian phenomenon of separate restrooms.

The connection of public bathrooms with condemned sexual behavior also relates to our recent history of criminalizing homosexuality. For most of the twentieth century, gay sex was criminal, and public disclosure of a man’s homosexuality spelled the death of his reputation and career. Public restrooms were sites of clandestine sex among men, and undercover police engaged in bathroom surveillance to catch men seeking sex in toilet stalls. David Sklansky, a law professor at Stanford, has argued that modern legal ideas of privacy were forged in the nineteen-sixties in part because of the Supreme Court’s distaste for this sordid police practice. According to his theory, bathroom sex is the “secret subtext” of Katz v. United States, which requires the police to have a warrant to eavesdrop electronically on a call made from a telephone booth, and is the source for the modern idea that the Constitution protects a reasonable expectation of privacy. Since Lawrence v. Texas_,_ in 2003, it has been unconstitutional to criminalize gay sex taking place in private, but this protection does not apply to sex (gay or straight) in public spaces. As late as 2007, Senator Larry Craig was arrested in an airport-restroom sex sting for signalling interest in sex with a stranger in an adjacent stall, and convicted of disorderly conduct.

Whereas homosexuality was until recently considered the paradigm of sexual deviance, today’s bathroom debate focusses on heterosexual deviance. The undercover figures we imagine are not snooping cops but rather heterosexual men who might pretend to be women “that day” to follow women and girls into restrooms. I’m not aware of reliable statistics that would indicate that public bathrooms are more sexually dangerous than any other places—or would be, were they to be desegregated—though the history of bathroom sex does associate the space with sexual conduct. Even if the sexual-assault argument against allowing transgender restroom access is implausible, it is still hard to come up with an account of why public bathrooms should be gender-segregated that does not rely on a gendered version of privacy and safety that recapitulates “separate spheres” and sexual vulnerability.

Today, men and women, not assumed to be only heterosexual, are expected to function at work alongside one another, eat at adjacent seats in restaurants, sit cheek by jowl in buses and airplanes, take classes, study in libraries, and, with some exceptions, even pray together. Why is the multi-stall bathroom the last public vestige of gendered social separation? When men, gay or straight, can stand shoulder to shoulder at urinals without a second thought, is there much to back up the view that men and women must not pee or poop next to one another, especially if closed stalls would shield them from view? Women may have some distinctive sanitation needs, but why does that require a wholly separate space from men?

Perhaps the point is precisely that the public restroom is the only everyday social institution remaining in which separation by gender is the norm, and undoing that separation would feel like the last shot in the “war on gender” itself. As we consider the possibility of electing our first female President, the bathroom as the site of sex difference has been underlined by another candidate, Donald Trump, who said, “I don’t want to think about” the “disgusting” things Hillary Clinton was doing in the bathroom, in a comment widely understood to be about her female sex. Though both men and women must perform private bodily functions in public bathrooms, the mere thought of a woman doing it implied an irreducible sex difference that made plain a gross incongruity with the ultimate public role. Public restrooms are not just toilets; for more than a hundred years, they have implicated questions of who really belongs in public, civic, and professional life.

One practical reason we can’t change to unsegregated bathrooms overnight is that municipal, state, and federal legal codes, many with origins in the nineteenth century, mandate that there be separate facilities for each sex, in businesses and places of work. These widespread codes could be changed one by one. But it seems more likely that, when it comes to multi-stall bathrooms, gender segregation will remain the norm, and that we will see the addition of more single-stall restrooms that are open to any gender. Transgender people’s need to use bathrooms that match their identified gender is modest and not reasonably denied. Old ideology, in the meantime, stays alive in mundane legal regulation that resists more thorough change and determines our plumbing.