Clayton Cramer on mental disabilities
Clayton Cramer has a post on the issue.
The ultimate question comes under "damned if you do and damned if you don't." Before 1970s or so (i.e., just before I went to law school) the committment laws allowed committment of just about anyone with any significant mental quirk. Arizona Law Review had an issue on that, and they tracked down the person who'd had the longest time in the state mental hospital ... a woman committed something like 50 years before because the doc said "she always felt like dancing."
The legal reforms that went in after that basically deinstitutionalized all but a handful of the mentally ill. As a general rule, unless a person could be proven an immediate danger to self or others (which is hard to determine unless maybe they were paranoid schitz and specifically said they were going to kill someone else) or so completely disabled as to be unable to function, they could not be held. A large part of those released, or not held, wound up on the streets, of course. Of course in the old days there was no real treatment for serious disorders. At best, you warehoused them, usually for their lives. Today you have enormous advances in psychiatric medications, but if the person won't take them, you're out of luck. And some take quite a while to kick in, weeks sometimes, so you can't just make the guy pop a pill and reach a state where he realizes he really is better off on the medication.
The bottom line was that there was no good solution -- at best, you can look for the "least bad" one.