It also only happens because people prey on the goodwill and charity of doctors as a profession.
Imagine if plumbers or mechanics or builders decided to walk off the job - the government wouldn't be forcing them to work, and wouldn't have the guts to try to shame them into working.
I mean...kind of...but not really.
My spouse works for the federal government, they do this with just about every profession that they can deem essential. My government just recently forced postal workers back to work.
It's also less that MDs are just so nice, but more that in democratic countries where medicine is publicly funded, the government has the doctors by the balls. And because the negative impacts of bad-faith negotiation take so long to have effect, no elected politicians are particularly motivated to do what it takes to protect the integrity of a public health system.
Healthcare is extremely expensive, so it's an easy target to take small bites out of at a time, which does not tend to obviously impact the voters in a clear, natural consequences kind of way, so it's an incredibly easy target for cost savings, and over time, those bites add up to irreversible damage.
Each individual bite has no impact on the re-electability of the politician who approved it, so there's little to no incentive not to take any given bite. And then when the bites do add up and create a crisis, the government facing the crisis is usually facing something waaaaay to expensive to reasonably fix, and again, something that the average voter probably isn't impacted by.
The erosion to mental health hospital services has probably happened over many years, and many bites, and now is probably so cumbersome and expensive to try and fix that it would be politically unpopular for whomever is currently in power to dedicate
that much in the way of resources to trying to fix a horribly broken system, which most voters wouldn't even care about, because the public has never given a fuck about mentally ill people.
It's political suicide to
actually try and fix medical systems, and even worse, the solutions take aaaaages to actually work, so the same way the bites take years to pay off, so do the investments, so they rarely actually translate into votes.
No one politician or government ever gets the blame for breaking healthcare, and no one politician or government ever gets the credit for fixing it, and it's a MASSIVE portion of people's taxes, so it's a sitting duck target for what we call in the medical world "supervised neglect."