LAST WEEK’S elections in Tennessee brought yet another reminder that judicial races, which the vast majority of states conduct, are a corrosive practice that should end.

Leading up to the poll, Ron Ramsey, Tennessee’s Republican lieutenant governor, helped to wage a sharp campaign against three state supreme court justices, all appointed by a former Democratic governor. The effort to oust the judges included accusations that they are soft on crime — a standard charge lobbed at judges in election campaigns — and that they aided Obamacare. The latter is particularly ridiculous, flimsily based on the fact that a Tennessee attorney general, whom the state supreme court selects, declined to join in a lawsuit against the health-care law.

Even so, the judges felt compelled to spend hundreds of thousands of dollars to beat back the assault, itself fueled by hundreds of thousands of dollars from Mr. Ramsey’s political action committee and national conservative activist groups. Though the judges eventually prevailed, the fact that they had to politick their way back to the bench discredits the notion that they will be fair to all who enter their courtroom.

Thirty-eight states have judicial elections of some kind for seats on their supreme courts — whether fully contested races or retention elections in which only an appointed incumbent is on the ballot. Typically, these elections aren’t major contests, which can be a problem in itself. Former Supreme Court justice Sandra Day O’Connorpointed out that many judicial candidates in what are supposed to be contested elections run unopposed, which means they are not vetted by voters, elected politicians or expert panels. Even in races with two or more candidates, often few people pay attention — and the ones most likely to care are those with direct stakes in how courts will rule. Defense attorneys face off against plaintiffs’ advocates.

But more judicial races are becoming high-profile, and that’s also bad. Political parties and conservative and liberal pressure organizations are spending more to knock out judges they see as ideological opponents. According to a Brennan Center for Justice analysis, $56.4 million was poured into judicial elections in the most recent major election cycle, nearly half of it from non-candidate groups.

The results of applying the ideological polarization that dominates the political branches to judicial races, meanwhile, are consistently unattractive. One-issue voting dominates some contests, such as the successful effort to oust Iowa judges who ruled in favor of same-sex marriage or the unsuccessful campaign against a Wisconsin supreme court justice whom critics attacked as a proxy for Gov. Scott Walker (R). Elsewhere, conservatives have accused judges of helping to free terrorists and of sympathizing with rapists; liberals have accused judges of covering up sexual abuse by priests and of helping to deny treatment to cancer patients.

The application of due process and the maintenance of Americans’ civil rights should be more isolated from the pressures of majoritarian elections. States with judicial elections — such as Maryland — should adopt a fully appointment-based system to select their judges.