There is a big difference between mental ill health and insanity.
There is also a school of thought, that he may be frightened of trying to cope outside, and prefers the 'structure' of institution.
I think you know the answer. There were a lot of people in hospital who shouldn't have been, like girls who got pregnant outside of marriage etc, but as I said, the closures went too far.
There were far too many mental hospitals & too many people trapped in them, but by closing the vast majority of them, the baby was thrown out with the bath water.
There are a lot of mentally ill people in prison, who shouldn't be. It all boils down to money.