Justice Sonia Sotomayor, writing for an eight-justice majority, said the case involved a clash of those two principles.

“The question before the court,” she wrote, “is whether the automobile exception justifies the invasion of the curtilage. The answer is no.”

“To allow an officer to rely on the automobile exception to gain entry into a house or its curtilage for the purpose of conducting a vehicle search,” Justice Sotomayor wrote, “would unmoor the exception from its justifications, render hollow the core Fourth Amendment protection the Constitution extends to the house and its curtilage, and transform what was meant to be an exception into a tool with far broader application.”

“Indeed, its name alone should make all this clear enough,” she wrote. “It is, after all, an exception for automobiles.”

Justice Samuel A. Alito Jr. dissented, saying the search had been reasonable and thus constitutional. The motorcycle, he wrote, was just a car’s length or two from the curb. “If the motorcycle had been parked at the curb, instead of in the driveway,” he wrote, “it is undisputed that Rhodes could have searched it without obtaining a warrant.”

In defending the search, Virginia officials urged the Supreme Court to draw a distinction between enclosed structures like garages and other areas around a home. Justice Sotomayor said that would give richer people more protection.

“Virginia’s proposed bright-line rule automatically would grant constitutional rights to those persons with the financial means to afford residences with garages in which to store their vehicles,” she wrote, “but deprive those persons without such resources of any individualized consideration as to whether the areas in which they store their vehicles qualify as curtilage.”