Interesting post!
Hospitals are ideal for quarantine if infections disease.
In terms of mental illness. Group cognitive behavioral or mindfulness sessions are actually very effective. So it may not be the interaction it is the kind of interaction the patients are getting.
You are right about the needs of some mental patients. The problems that are seen most often are some which can most benefit from a community of people who are going through the same problems. I've talked to several people who needed help but couldn't afford the doctors. They felt much more capable of coping when they started working in an online support group who were going through the same things and had techniques to share and constant moral support.