https://en.wikipedia.org/wiki/Dodge_v._Ford_Motor_Co.
The above ruling is a problem, but the reality of the situation falls somewhere in between. If a facility of any kind has an obligation to produce anything, even if there are reasons not to (harm to the facility, uneconomical operation conditions, etc.) it makes it nigh impossible to get investment into future developments and facilities, and existing backers pull out. Unlike the police, which are forcibly paid through tax, in states like Texas, the government does not run the power companies.
So an obligation to exist is entirely a product of the market in those places, as is the obligation to operate at any given time. Anything else would be either a form of slavery or socialization, both of which will not fly with the people of Texas.
The above is not an endorsement of the ideas so much as my understanding of the legal reasoning. I agree with the judge but probably not for the same reasons.