Your explanation is surface level correct, in that it is in essence society's justification, but ultimately they're run like prisons because it's initially cheaper to treat all mental health patients the same and because there might be one individual that is a danger to themselves (and even less likely, others) then we get the 'prison-style'.
The trouble of course comes in that in the long term this model likely costs far far more, because it's incredibly damaging as human brains don't fit in boxes.
Stop. Please stop. Doomerism compounds the problem, it is not a neutral stance.
Has irreparable damage already been done? Yes.
Will it be worse if we don't do anything as soon as possible? Yes. And each moment that we don't do the thing, it gets a little bit worse.
But each moment we do do the thing, it gets a little bit better.
The Earth will relatively be 1.5°, likely 2°C hotter, regardless of what actions are now taken. But 2°C hotter is far, far preferable to 4°C.
Everything we do as individuals and societies matters. I understand it feels daunting, and I'm not really advocating for you to drive less or eat less meat, because ultimately these changes won't be driven by individuals making the choices.
However, please please please support and push, protest, fight for societal changes for us collectively to drive less, eat less meat, and corporate carbon taxation.