Supreme Court justices, like other federal judges, are appointed for life and are meant to be insulated from politics. But judges in 39 states face elections that are often awash in money, creating a tension between accountability and independence. Their contributors often appear before them, and some studies have found that elected state Supreme Court judges tend to vote in favor of their contributors.

The Supreme Court has struggled with how much leeway to grant states in regulating judicial elections. In a 2002 decision, it allowed judges running for office to take stands on political and legal issues. But in 2009, it required the chief justice of the West Virginia Supreme Court to recuse himself from a case over $3 million of campaign spending on his behalf by an interested party.

Wednesday’s decision stressed that judicial elections are different. “Judges are not politicians,” Chief Justice Roberts wrote, “even when they come to the bench by way of the ballot.”

The case, Williams-Yulee v. Florida Bar, No. 13-1499, concerned Lanell Williams-Yulee, who lost a race for a seat on the county court in Hillsborough County, Fla., which includes Tampa. She was reprimanded and made to pay $1,860 in court costs for signing a fund-raising letter.

Image Lanell Williams-Yulee was reprimanded after signing a fund-raising letter when she ran for a Florida county court. Credit... Tampa Tribune, via Associated Press

The Florida Supreme Court upheld the penalties and the state’s solicitation ban, saying it helped “ensure that judges engaged in campaign activities are able to maintain their status as fair and impartial arbiters of the law.”