I guess because a physician can refuse to see a patient at his private office but a hospital is required to treat any one who shows up in the ER. If they don’t accept Medicare and Medicaide they close up.
The ER isn’t required to do elective things, only to make sure people are stable enough to release. What if someone showed up in one claiming they need cosmetic surgery?
There's a place down the street which used to be a hospital. They shut down their ER and are now a "Care Facility". With no ER, they are no longer required to accept all comers.