COURTS, in theory, are bastions of independence and impartiality. But that image is tainted when campaigns pass the hat for contributions, or benefit from spending by others. Earlier this month, a race for Pennsylvania’s Supreme Court was fuelled by at least $16.5m in campaign spending—the most expensive judicial election America has seen to date.

Democrats outspent the Republican candidates more than three-to-one and scored a resounding victory on November 3rd, taking all three open seats on the court to reach a 5-2 majority and increase the likelihood of left-leaning decisions from Pennsylvania’s highest tribunal. Crucially, these seven judges choose the tiebreaking member of a bipartisan commission charged with drawing the state’s electoral districts. So the win may pay dividends for the Democrats in state legislative races over the next decade as well.

The three Democrats elected to the Keystone State’s highest court owe their gavels primarily to organised labour and plaintiffs’ lawyers, their two most generous blocs of financial support. Christine Donohue, Kevin Dougherty and David Wecht, the three winning candidates, took in $2.1m from unions and another $1.7m from lawyers.

These Democratic victories ought to be troubling for Democrats. Hillary Clinton, the front-runner for the party’s nomination, has railed against Citizens United v Federal Election Commission, a decision of 2010 that enabled outside groups to spend freely in election campaigns. The ruling, she said, protects “the right of billionaires to buy elections”. But Citizens United is precisely the wrench that opened the spigot of outside dollars for judicial candidates in Pennsylvania.

Mr Wecht opposes the principle in Citizens United that spending money is protected by the First Amendment’s guarantee of freedom of speech. He admits, however, that money helped the Democrats take command of the Pennsylvania Supreme Court. He ran on a platform calling for a ban on gifts to judges. “The opportunity to serve as a judge is a solemn responsibility and a public trust,” his campaign declared. “The exchange of favours has no place in the judicial process.”

Massive campaign spending in judges’ elections, according to Liz Seaton, interim head of the campaign group Justice at Stake, “is a giant and growing storm that threatens justice”. The candidate amassing the largest war-chest wins more than 90% of contested state Supreme Court races, she has pointed out. Ms Seaton and other critics think the selection of judges should be taken out of the hands of the people and entrusted to panels of experts instead.

Some members of the Pennsylvania legislature have similar plans. A Republican lawmaker, Bryan Cutler, has proposed an amendment to the state constitution establishing a bipartisan commission to scrutinise would-be judges’ records. The body would send a few names to the governor, who in turn would choose a nominee from the list to propose to the state Senate for confirmation. Many states use a variant of this so-called Missouri Plan—which is named after the state which, in 1940, became the first to use merit selection. But the chances of Pennsylvania adopting such a change right away are nil. Both houses of the state legislature would have to approve the measure two years in a row, followed by a state referendum in which the people agree to give up their power to elect judges themselves.