It seems sometimes to be a circular argument. The person is loose in society. The person kills someone and asserts an insanity defense. So, if the person was insane, why was the person allowed to be loose in society?
The dirty little secret in one word: VOTE.
In the 1970s the RATS, in the name of "modern medicine" and "compassionate care" brought about, in effect, the closure of the insane asylums and state hospitals, and the "assimilation" those patients into half-way houses, out patient clinics, sidewalks, subways, and city parks. They were "free", they were "assimilated", they could - and were, and are, rounded up and herded to -- vote.