Like the slaying of Samuel Ratchett in Agatha Christie’s “Murder on the Orient Express,” the botched American response to the coronavirus pandemic is the work of a large cast of characters — from federal agencies to the White House to certain governors. So far, the courts have largely escaped public opprobrium. But a review of their decisions suggests that the judiciary deserves a share of the blame — for interfering with legitimate public health policies and using the pandemic to score points in the culture wars.

Unhappy with lockdowns, mask requirements, vaccination mandates and other measures, Americans did what Americans do — they sued. Plaintiffs in these cases were “nonessential” businesses whose operations were shut down or restricted; religious organizations who were told to close or limit attendance in houses of worship; politicians and activists whose campaigns were restricted; landlords whose evictions were suspended; and ordinary citizens whose commercial, political or personal activities were burdened by mandates of various sorts. Every imaginable constitutional theory was advanced, including claims that the orders violated property, religious, speech, gun and abortion rights, rights to travel and choose one’s profession, and rights to equal protection and due process.

To determine how often plaintiffs were successful, in a recent paper we examined more than 150 federal cases involving nonreligious civil liberties challenges to coronavirus-related public health orders, from March 2020 through June 2021. Our findings supplement work by another legal scholar, Zalman Rothschild, who has examined an additional 38 cases involving challenges to coronavirus policies based on religious rights.

Combining our data with Rothschild’s gives a picture of how deferential the courts were to the political branches. Overall, the courts struck down orders in about 20 percent of the cases — more at the height of the emergency in the spring of 2020 (30.4 percent) than later on (10.8 percent).

In ruling against the government so frequently, American courts departed from their traditional practice of giving slack to the government when it must act in times of great national danger — typically during wars, but during public health emergencies as well.

In the 1905 case Jacobson v. Massachusetts, for example, the Supreme Court upheld a law that required adults to receive a smallpox vaccination or risk a fine. In its opinion, the court admonished lower courts not to “usurp the functions of another branch of government.” And while it acknowledged that a law or order could go too far, the court firmly declared that an order should be upheld unless it “has no real or substantial relation to those objects [public health], or is, beyond all question, a plain, palpable invasion of rights secured by the fundamental law.”

So, for example, if public health authorities declared that only Republicans must wear masks, or mosques but not churches will be shut down, the Jacobson standard would not be satisfied. (Indeed, late in the 19th century, a court struck down public health orders that required only Chinese residents in San Francisco to be vaccinated and quarantined, which was clearly an attempt to harass a vulnerable minority based on a spurious emergency.) But it is hard to argue that recent laws presented such a “plain, palpable invasion of rights.”

Politicians have clearly been grappling with a real emergency: The pandemic has killed more than 600,000 Americans so far. There is no doubt that lockdowns and related mandates have “a real or substantial” relation, in the words of Jacobson, to the goal of curbing the spread of the virus.

What, then, accounts for the rulings against governments? In a word, the culture wars. Religious organizations won 37.4 percent of the time, compared to nonreligious organizations, which won only 12.7 percent of the time. This difference is due to a remarkable partisan divide among judges. As Rothschild found, judges appointed by Republican presidents sided with religious organizations almost two-thirds of the time, while Democratic-appointed judges never ruled in favor of religious organizations. Judges appointed by President Donald Trump sided with religious organizations 82.1 percent of the time. The Supreme Court, similarly, split almost exactly along partisan lines when it first upheld restrictions on churches, and then changed its mind, thanks to the replacement of liberal Justice Ruth Bader Ginsburg with conservative Justice Amy Coney Barrett. (Chief Justice John G. Roberts Jr., to his credit, stuck to his principle that the courts should defer to the government during public health emergencies regardless of whether conservative or liberal oxen were gored.)

For most of the run-of-the-mill cases involving shutdowns and other mandates that restricted commerce and politics, the courts sided with the government with relatively little partisan disagreement. But Democratic-appointed judges and Republican-appointed judges split in predictable ways on orders that restricted abortion and gun rights, with Democratic judges mostly opposing suspensions of nonessential medical procedures that encompassed abortions, and Republican judges mostly opposing shutdowns of gun ranges, though the numbers were small.

Judges who struck down public health orders rarely did so because they rejected the underlying science on which the orders were based. They understood that they lacked the expertise to second-guess the doctors and epidemiologists who advised governments. Instead, they argued that the orders unfairly favored some groups over others.

In the religion cases, for example, many judges were persuaded that a government cannot close a house of worship if it leaves open liquor stores, bicycle repair shops and laundromats. Surely, religious worship is more important than picking up a bottle of scotch. But the public health regulations were based not on an assessment of the relative importance of these activities; they were based on evidence that the coronavirus spreads rapidly when people congregate indoors to sing and speak for an extended period. That’s why movie theaters and concert halls were typically closed along with houses of worship. People rarely dawdle in liquor stores — and in grocery stores, they’re not required to sing for their supper. By exempting religious organizations from rules applicable to institutions that were similarly situated from an epidemiological standpoint, the courts put God over public health.

Other decisions were rooted in even weaker logic. In some places, the government kept open businesses that sold food while closing businesses that sold nonessential items such as furniture. This meant that some large businesses like Walmart, which sold food and furniture, stayed open. A federal court in Pennsylvania struck down the order as arbitrary since it “favored businesses which offered more, rather than fewer products.” Similarly, a federal court in New York struck down a ban on ticketed music events because trivia nights and movie theaters were not similarly restricted.

These courts did not seem to appreciate that if governments were forbidden to draw simple lines between essential and nonessential, they would be required to write elaborate rules tailored to thousands of different businesses, of every imaginable variety. The resulting complexity of such laws would infuriate the public and stifle the public health response.

The surge of partisanship among judges in the midst of a public health emergency of the greatest magnitude underscores the wisdom of deference, as illustrated by Jacobson. If judges cannot rule impartially, then they should defer to governments, who are mostly well-motivated, and much better situated, to advance public health. We might have predicted that the culture wars would hamper the government’s response to the pandemic. But we should have expected better from judges, who have sown confusion at the worst possible time.