The answer is: California
The purpose of that law is to ensure that the fund for the support could be allocated to other people that have better chance of living.
The total fund for health care is very limited, and not all citizens are eligible to obtain the service that they need. When further treatment is judged as futile, pumping more money to the treatment would not bring any positive value to that patient. But, if it's allocated to other patient with higher priority,government's investment for that patient wouldn't become a waste.