U.S. District Court Judge Edward Chen refused to block the ban temporarily or to allow a lawsuit challenging it to proceed.
"In spite of what plaintiffs argue, nudity in and of itself is not inherently expressive," Chen wrote in an 18-page opinion.
The San Francisco Board of Supervisors voted 7-4 last month to prohibit residents and visitors over age 5 from exposing their genitals on public streets, in parks or plazas or while using public transit.
The measure was introduced in response to a group of nudists that regularly gathers in the city's predominantly gay Castro District. The threat of seeing outlawed a right that many people associate with free-spirited San Francisco prompted public protests and disrobing at supervisors meetings.
The activists who challenged the measure in court also had argued that the ordinance was unfair because it grants exceptions for public nudity at permitted public events such as the city's gay pride parade and the annual Bay-to-Breakers foot race.
Chen also rejected that argument.
"The plaintiffs took an unlikely position in their case that if they couldn't be naked everywhere, no one could be naked anywhere," City Attorney Dennis Herrera said. "We believed their legal challenge to be baseless, and we're grateful that the court agreed."
Christina DiEdoardo, a lawyer for nudity advocates who sued to overturn the ban, said her clients were considering whether to appeal. DiEdoardo noted that the judge indicated he would be open to considering a revised lawsuit if advocates could cite examples of their civil rights being trampled, which could be easier to do once the ban is enforced.
"We can still come back once the ordinance takes effect," she said.
More Nation & World Headlines
Afghan hospital attack stemmed from U.S. airstrike, general says 3 share Nobel medicine prize for new tools to kill parasites 2 Palestinian teens killed by Israeli troops South Carolina flood: Door-to-door searches, swamped roads Coast Guard: Missing ship sank, 1 body found, search ongoing Syrian refugees increasingly return to war zones in homeland ER nurse discovers fatal hit-and-run victim brought to hospital is her brother Clinton pitches new gun controls following Oregon shooting
Our new comment system is not supported in IE 7. Please upgrade your browser here.