The Affordable Care Act has been so good to health-care stocks that even a small possibility of change should cause concern.

The sector again sold off sharply Monday in the wake of a federal judge’s ruling last week that the law known as Obamacare is unconstitutional. Shares of hospital operator
Tenet Healthcare
and Medicaid-focused insurer
Molina Healthcare
both slid, for example. Including Friday’s losses, those two were off by 13% and 20%, respectively, by midday Monday.

The investing risks the ruling introduces are hypothetical but potentially severe. The law is still in place for now, so the ruling won’t directly impact the sector’s business operations and it could be years before all appeals are heard. This isn’t the first time that this politically charged law has faced a challenge.

Those caveats aside, the financial threat is real if the ruling sticks. By expanding access to health insurance via state exchanges for individual policies and a major expansion of Medicaid eligibility, Obamacare created millions of new customers. The result is an ideal environment in which to sell insurance, hospital beds, medical devices or pricey new prescription drugs.

There is a real chance that this environment evaporates and the downside could be significant. A broad index of health-care stocks has nearly tripled since the law passed in 2010. Whatever policy framework replaces it would likely reduce access to health insurance, creating a ripple effect on consumption.

Health care has been the strongest performer in the S&P 500 this year, living up to its reputation as a haven during uncertain times.

Losing that port in the storm could cause health problems up and down Wall Street.