The Supreme Court struck down a Los Angeles ordinance Monday that allowed police to inspect hotel guest records on demand.
The justices voted 5-4 to reject the city's argument that the measure was needed to help fight prostitution, drug trafficking and illegal gambling at budget hotels and motels.
Los Angeles said that people engaging in those activities are less likely to use hotels if they know the facilities must collect guest information and turn it over at a moment's notice.
But Justice Sonia Sotomayor said for the court that the law is unconstitutional because it penalizes the hotel owners if they don't comply. "A hotel owner who refuses to give an officer access to his or her registry can be arrested on the spot," Sotomayor wrote. Business owners must at least be given a chance to object to a judge, she said.
Justice Anthony Kennedy and Sotomayor's three liberal colleagues joined her in the majority.
In dissent, Justice Antonin Scalia said the law "is eminently reasonable" given the use of cheap motels as places to stash migrants who have been smuggled across the border and as rendezvous points for child sex workers and their clients.