The Supreme Court on Thursday refused to serve as an arbiter for what counts as extreme partisan gerrymandering, opening the door for politicians of both parties essentially to pick their voters, disfavoring parties that are not in power. The decision is anathema to America’s democratic ideals.

Chief Justice John Roberts wrote in a majority decision joined by all four of his conservative colleagues that federal courts have no power to entertain claims that politically motivated map drawing violates the Constitution. In law-speak, such questions are “nonjusticiable” — judges have neither the authority nor a proper standard to weigh such claims. “In this rare circumstance, that means our duty is to say ‘this is not law,’ ” the chief justice wrote.

Justice Elena Kagan, reading a pained dissent from the bench, called the decision “tragically wrong” and expressed “deep sadness” over what the outcome will mean for the nation.

“Of all times to abandon the court’s duty to declare the law, this was not the one,” Justice Kagan wrote in her dissent, which was joined by her three liberal colleagues. “The practices challenged in these cases imperil our system of government. Part of the court’s role in that system is to defend its foundations. None is more important than free and fair elections.”