On reason is to prevent people from harming other people, either directly if they're crazy, or passively by spreading a disease.
Another is to prevent them hurting themselves. If you know that they are drug addicts or depressing, you can be different around them and encourage them to do good and positive things and prevent things such as suicide or anything similar.