Chief Justice Roberts said that went too far. States remain free to decide that “some forms of advocacy should be excluded from the polling place,” he wrote. He cited with seeming approval more focused laws in California and Texas aimed at classic electioneering.

“Casting a vote is a weighty civic act, akin to a jury’s return of a verdict, or a representative’s vote on a piece of legislation,” the chief justice wrote. “It is a time for choosing, not campaigning. The state may reasonably decide that the interior of the polling place should reflect that distinction.”

But Minnesota, Chief Justice Roberts wrote, had failed to “articulate some sensible basis for distinguishing what may come in from what must stay out.”

There is no problem with banning items supporting or opposing candidates or ballot measures, he indicated. But Minnesota also barred materials “designed to influence or impact voting,” which officials interpreted to cover messages touching on any subject that had been addressed by candidates and their parties.

“A rule whose fair enforcement requires an election judge to maintain a mental index of the platforms and positions of every candidate and party on the ballot is not reasonable,” Chief Justice Roberts wrote.

The state also barred apparel and insignia that promoted groups with political views. Chief Justice Roberts said that could cover the American Civil Liberties Union, AARP, the World Wildlife Fund, Ben & Jerry’s and the Boy Scouts.

When the case was argued in February, a lawyer for the state was peppered with questions about what was and was not allowed. His answers, Chief Justice Roberts suggested, betrayed no consistent theme.