Because you're treatment people differently based on something outside of their control. Just because you can justify why you'd want to act that way, in no way makes it any less wrong.
Asking if it is right to judge people based on their mental health is an entirely different topic than asking if we can judge people based on a physical characteristic they were born with and have no control over. Apples and oranges.