It is both immoral and illegal to fire a person purely because they have a mental health condition. When performance or conduct issues are in question, the employer must first consider whether they have provided reasonable accommodations. These are intended to allow the employee an opportunity to recover and reach an acceptable level of performance. If performance or conduct have not improved despite employers providing reasonable accommodations, non-discriminatory termination is possible under US labor law.
In any event, employers must document relevant performance or behavioral issues and the accommodations provided to allow for recovery. They should also have legally compliant policies related to mental health and disability accommodations and ensure that employees are aware of them. Dismissal on medical grounds is not only an unfortunate last resort but also complicated from a legal and procedural perspective, so consulting a labor law professional is advised so that the process is as fair, considerate and respectful as possible.