AMERICA’S UNUSUAL practice of electing judges has long undermined the integrity of the justice system. But the problem is getting worse: In the Citizens United age, the courtroom is becoming the next frontier in rancorous political division.

The last election cycle saw a record $24 million spent on judicial elections by outside groups, according to the Brennan Center for Justice at New York University Law School. This cycle is still underway, but the signals are discouraging. Just one outside spending group, the Republican State Leadership Committee, is devoting $5 million in its “Judicial Fairness Initiative” to promoting candidates “supportive of restraining government” and to attacking candidates who don’t fit the description, the Wall Street Journal reports. The group financed a trumped-up assault on the Tennessee Supreme Court over the summer, misleadingly accusing justices of failing to stand up to Obamacare. The attack failed, thankfully, but not without doing harm; the judges had to solicit $1 million in donations to fend it off. Now the committee is attempting to steer judicial elections in Missouri and Montana and potentially in Ohio, Michigan, Illinois and Texas.

Defenders of spending by conservative groups argue that it counters the donations of unions and trial lawyers, from which money has long flowed to judicial candidates. True, activists of many stripes have donated, and the results have often been nasty. Sitting judges have been attacked for helping to deny cancer treatments or assisting in the release of terrorists. They are regularly accused of being soft on crime. These attacks, or the threat of them, may have chilling real-world effects: There is statistical evidence to suggest that judges hand out longer sentences as Election Day approaches.

Candidate spending on television ads in North Carolina’s judicial elections has passed $1 million, and would-be judges now have to raise money themselves after the legislature revoked public financing of judicial campaigns. This term the Supreme Court will hear a challenge to Florida’s restrictions on judicial candidates soliciting donations. Keeping the limits would help preserve trust in the judiciary; overturning them would invite the appearance and reality of impropriety in judging.

Even if the court upholds the limitations on solicitation, outside spending seems destined to keep growing. Regulating judicial elections is better than doing nothing, but it is not the best approach. Eliminating them is. A judge’s job is not to serve a constituency, a particular donor or an ideology, as the Republican State Leadership Committee would have it. It is to make a good-faith effort to apply the law.