The basic answer to your question is that the mentally ill were put into institutions because society did not know what else to do with them as mental illness was traditionally thought to be the work of the devil, though by the 20th century this belief had faded. Some were kept at home if that was possible, but mental institutions were the easy solution for many. Out of sight, out of mind and then the families were free to live a normal life without the social shame of a family member having a mental illness. When families began to question why the institutions didn't help cure the ill, society began to question their effectiveness. Medications to really help the mentally ill didn't improve for many years until about the middle of the 20th century. Many of the mental illnesses were not identified with a name and characteristics until much later depending on the illness. Today, as a member of a family where a sister and a son have a mental illness, understanding of mental illness is lacking and has a social stigma attached. As a volunteer crisis counselor at a jail, I have found the jails to be the new holding ground for the mentally ill especially the undiagnosed.