Matt Slocum / AP

Pennsylvania’s political landscape looks a bit more favorable to Democrats after a three-for-three sweep in the Supreme Court election last week, giving the party a 5-2 advantage on the panel—a sharp turn to the left for a court that has been primarily controlled by Republicans for decades. But beyond the implications for party politics in the commonwealth, it’s the highly politicized and vicious nature of the election that’s raising eyebrows.

The race topped the record for the most expensive judicial election in U.S. history, coming out at about $15.8 million—a tally likely to rise as final numbers are calculated. It’s hard to ignore anything with that high a price tag, but when it’s the cost of choosing judges that will resolve questions impacting millions of citizens, things tend to get even dicier. Pennsylvania was the theater for the record-breaking spectacle this year, but it provokes questions about where money might influence the system next—and at what cost to judicial virtue?

The Pennsylvania Supreme Court, which antedates the United States Supreme Court, was once one of the most respected state-level courts in the country. It could strike down Pennsylvania’s laws long before Marbury v. Madison established the power of judicial review at the federal level. But by the late 1970s, according to David Rudovsky, a senior fellow at Penn Law School, it had become highly politicized and ideological as a result of competitive and nasty election cycles. Now, Rudovsky told me, “it’s a court in total turmoil.”

Scandal after scandal has plagued the justices. That accounts for two of the three seats that were open for election this year: Joan Orie Melvin was suspended in 2012 and convicted the next year of campaign corruption charges; Seamus McCaffery stepped down last fall after accusations that he had been receiving pornographic emails surfaced. And another sitting justice is currently being investigated for related accusations, which could create an additional vacant seat soon. Is it just a coincidence that the court is one of the most politicized in the country and has become so disgraced? Rudovsky—and many other scholars—don’t think so. He says the chaos of the court can, in many ways, be traced to its increasing politicization. “It totally corrupts the system,” he said, and the phenomenon is not unique to Pennsylvania.

Judicial elections have long divided legal scholars: On the one hand, allowing citizens to directly elect judges makes the process more democratic, allows people to engage key issues before the court, and holds judges accountable for their interpretations of the law. But on the other hand, the judicial system is intended to be shielded from devolving into a political melee.

When $15.8 million poured into the elections in Pennsylvania this year, though, a melee is precisely what ensued. All three Democratic candidates raised more than the top Republican did, and altogether they nearly quadrupled the GOP field’s haul. Most of the money came from outside interest groups. The cash paid for TV airtime and attack ads. The race turned ugly.

“[Kevin] Dougherty shockingly allowed a young girl to be placed in the custody of a convicted murderer,” one Republican State Leadership Committee ad said. “Anne Covey has a problem, Covey says she authored numerous published legal articles—she didn’t,” alleged another from Pennsylvanians for Judicial Reform, an independent group supporting Democrats. Pennsylvania’s top newspapers denounced the overwhelming influence of negative ads in editorials.

It’s easy to ignore a state-level judicial election, but the decisions of the court—regardless of despair and disgrace among the justices—are constitutionally binding, and will change the political landscape in Pennsylvania.

Perhaps most significantly, the makeup of the court plays a key role in determining the control of the state legislature, and the composition of the state’s congressional delegation. The justices together appoint the fifth member of the Legislative Reapportionment Commission, which is otherwise split 2-2 between Republicans and Democrats. That group is responsible for redrawing election maps after the census—it next takes place in 2020. With Democrats now in control, Pennsylvania could end up with a final districting plan more favorable to the party—breaking with a national trend toward more influence for the GOP.

And the way the court approaches new questions that land on its docket will affect its jurisprudence, which controls all jurisdictions in the commonwealth—and influences judges and lawyers. Rudovsky, who is also a public-interest lawyer and represents death-row inmates, told me that the commonwealth’s criminal-justice standards could see a marked shift. The panel has traditionally been “very pro-prosecution” (in 2013, it refused to retroactively apply a Supreme Court decision that struck down mandatory life sentences for juveniles), but could ease toward a more moderate standpoint with the new justices. Beyond criminal justice, the court will probably also hear appeals on other key topics like gun control (which splits Philadelphia voters from most of the rest of the state), funding for education, and voter-ID laws.

Exactly where the court’s new direction will play the greatest role remains a guessing game at this point. What’s certain, though, is that there will be some substantial outcomes favorable to the left. Judicial elections in the state seem likely to become more politicized, and more vitriolic. This time around, Pennsylvania Democrats just happened to be the beneficiaries.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.