(Bloomberg Opinion) -- A Trump-appointed federal district court judge in Western Pennsylvania has issued a ruling declaring Pennsylvania’s coronavirus lockdown restrictions unconstitutional. It gives an unfortunate boost to Donald Trump’s efforts to depict Covid-19 safety measures as overblown, but it  could well be reversed on appeal — after all, most of the restrictions the judge struck down are currently suspended.

Nevertheless, it is worth emphasizing that the court’s judgment isn’t completely unexpected at this stage in the pandemic. As the immediacy of the emergency waxes and wanes in different places, there is reason to expect that courts in zones with relatively low numbers of Covid-19 cases will start holding that more aggressive restrictions are situationally inappropriate. It’s therefore sensible for states to calibrate their emergency responses carefully, and provide concrete justifications for emergency policies as soon as it is practicable to do so.

The Pennsylvania restrictions struck down by the court are similar to those adopted in many states around the country earlier this year. One, dating back to July, restricted indoor gatherings in the state to 25 people and outdoor gatherings to 250. A second directed citizens to stay at home except for a range of basic activities. (There is some debate about whether this was an order or merely an advisory.) The third divided businesses into the categories of “life-sustaining” and “non-life-sustaining,” closing the latter.

A cautious judge would have avoided ruling on the constitutionality of the stay-at-home and business orders, because they are now suspended everywhere in Pennsylvania. Instead, the judge, William Stickman IV, who has been on the job for just over a year, chose to issue a decision based on the theory that the governor and public health officials could reinstate the suspended orders at any moment. Thus, he reasoned, the orders are therefore still in force.

That argument isn’t great — nor is it entirely preposterous. When civil liberties are in play, it’s good for courts to be vigilant. Yet judges are always well-advised to avoid making hard constitutional decisions when it isn’t warranted. One relatively easy way for the U.S. Court of Appeals for the Third Circuit to reverse much of the decision would be to hold that the district court shouldn’t have considered the constitutionality of orders that were not being applied to citizens at the moment of judgment.

Stickman spent a good portion of his ruling discussing the appropriate standard of review – the kind of technical legal issue that bores non-lawyers to death but that can matter a lot for how cases are decided.

The quality of his analysis was mixed. On the one hand, Stickman was correct to say that he would not apply a 1905 precedent, Jacobson v. Massachusetts, the case that says the government can require vaccination in a pandemic. It’s still good law, having never been struck down by the Supreme Court. But the case was decided before the era of modern civil liberties law, and the deference that the court gave to the government’s policy needs to be updated to fit contemporary constitutional doctrine.

On the other hand, in applying what is known as “intermediate scrutiny,” the judge seemed to demand that the government policies be much more narrowly tailored to fit the emergency than that standard ordinarily requires. He did so by treating all the state restrictions as trampling on fundamental rights to free assembly, due process and equal protection. Then he insisted that the restrictions didn’t adequately fit the government’s goal of curtailing the pandemic. In essence, Stickman second-guessed the Pennsylvania restrictions.

For example, he observed that the regulations allow for large numbers of people together in malls based on occupancy restrictions. This, the judge said, was in contradiction to the 250-person gathering limit. Yet it is common for government regulation to try to achieve an important policy goal without perfectly accommodating every situation — especially when the regulation is trying to preserve public safety while also allowing some modicum of a functioning economy.

Stickman also said that it was unconstitutional for the same restrictions to apply across Pennsylvania, in both densely settled cities and rural counties. This can’t be right as a matter of constitutional law; if the regulations apply differently in different places, opponents would have argued that they were unconstitutional for that reason.

There are plenty more legal problems with the ruling. It is not at all clear that there is a fundamental constitutional right to keep businesses open, for instance. The judge came dangerously close to reviving the long-discredited doctrine that there exists a right to do business under the due process clause of the 14th Amendment. The court of appeals will have a chance to correct this and other problematic formulations in the decision.

My main takeaway, however, is that while courts basically allowed states to impose whatever restrictions they deemed necessary during the early phases of the pandemic, at least some courts are going to shift gears now. In principle, that’s actually a good thing. We don’t want the necessary and appropriate emergency responses to the pandemic to erode our civil liberties.

This district court judgment has its problems, to be sure. And it is a shame to lend any credence to Donald Trump’s public stance that Covid-19 isn’t a serious matter. But even if this ruling is overturned, it sends a reminder to state authorities: Protect our health, but don’t forget to explain and justify these extraordinary uses of government power.

This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.

Noah Feldman is a Bloomberg Opinion columnist and host of the podcast “Deep Background.” He is a professor of law at Harvard University and was a clerk to U.S. Supreme Court Justice David Souter. His books include “The Three Lives of James Madison: Genius, Partisan, President.”

©2020 Bloomberg L.P.