It would seem obvious that students, like adults, have a physical need to use a bathroom during the school day. But in Massachusetts, many schools are closing bathrooms to avoid student misbehavior and vaping.

The condition of bathrooms in Boston Public Schools, and in other urban districts, has fueled public outrage for years, with broken taps and empty towel dispensers seen as sorry symbols of a failure to meet even basic needs.

But across the state and country, an even more fundamental problem is gaining attention: increasing restrictions on students’ access to bathrooms, as administrators keep more restrooms locked and off limits for more of the school day.

Driven by efforts to curtail teen vaping, and to prevent outbreaks of vandalism sparked by the TikTok trend known as “Devious Licks”, the widespread crackdowns on bathroom access have left students in some schools searching urgently for unlocked stalls — and pining for any open restroom, no matter how broken or dirty. As teenagers learn to hold their urine for hours – or stop eating and drinking at school to avoid discomfort — the outcry against the closures from students and parents has grown louder.

“I understand that there are safety concerns, but the whole school shouldn’t have basic human rights taken away,” said Nevaeh Lopez, 16, a student at Holyoke High School who started an online petition to push back against bathroom closures at her school this spring.

The issue has provoked fiery debate at school committee meetings and in online forums around the region in recent months, as well as calls and e-mails to principals and school nurses. A post about bathroom restrictions at New Bedford High School, on the New Bedford Live Facebook page in October, garnered nearly 200 comments, from students who described missing class time while waiting in long bathroom lines, and from adults who placed blame squarely on the teenagers. (“If they would act like civilized human beings they would be able to be trusted,” wrote one.)

There is no doubt uncivilized — and sometimes violent — acts have taken place in school bathrooms. Several students were suspended at Wilmington High School in March after they picked up another student and tried to force his head into a toilet in a boys’ bathroom. “What is equally disturbing is the fact that other students were present and did nothing to stop the incident, and in fact recorded the altercation,” Superintendent Glenn Brand said later.

School leaders nationwide have reported a general uptick in discipline and behavior issues, including fighting and bullying, since students returned to full-time, in-person school following two years of disruption. The troubling trend has been linked to the mental health toll of the pandemic, and to social development delays possibly caused by students’ recent isolation.

Student use of electronic cigarettes has alsorisen at “epidemic” rates in recent years, health officials have warned. As countless school bathrooms have become de facto vaping lounges, desperate school leaders have grasped at any possible solution, including removing doors from restroom stalls and installing vape-detection sensors.

Yet even Donna Mazyck — head of the National School Nurses Association and a leader in the fight to curb teen vaping — said rampant restroom shutdowns are not the answer…

Staffing shortages, exacerbated by pandemic burnout, have reduced the number of hall and restroom monitors available in many districts, forcing more closures of unsupervised bathrooms. But staffing is a problem that can be solved, said Worcester School Committee member Tracy O’Connell Novick, who spoke forcefully against the locking of bathrooms at the committee meeting in January.

“I taught high school, I know why we lock bathrooms, and I don’t think it should be against a policy — I think it should be against the law,” O’Connell Novick told the School Committee. “There are things that are right and things that are wrong, and denying students access to bathrooms is wrong.”