Mental asylums where used to house and treat mentally ill patients and people that were deemed mentally ill at the time. Not everyone in mental asylums had some type of mental illness. People that were homosexual were put in asylums too due to homosexuality being thought of and diagnosed as a mental illness.
Asylums were closed following the deinstitutionalization movement led by the government. However, these closings left many of the patients residing in them homeless and without any resources or support to fall back on.
Along with the deinstitutionalization movement asylums were becoming less relevant with the introduction to psychiatric medication and outpatient care.