WASHINGTON—The Supreme Court ruled Monday that police violated the Constitution when they attached a Global Positioning System tracker to a suspect's vehicle without a valid search warrant, voting unanimously in one of the first major cases to test privacy rights in the digital era.

The decision offered a glimpse of how the court may address the flood of privacy cases expected in coming years over issues such as cellphones, email and online documents. But the justices split 5-4 over the reasoning, suggesting that differences...