Mental illness alone isn't reason enough to deprive a person of his constitutional right to bear arms. There's no legal precedent for doing so. Mental illness and a criminal history of violent behavior are mutually exclusive. The mentally ill lose their gun rights for the same reason anyone else does: domestic violence, criminal history of violent crimes, history of suicide attampts, etc; things that would result in a court order disallowing gun ownership. 

Establishing mental illness is more difficult than it sounds, why should someone who is misdiagnosed lose their rights? It's also a slippery slope for a witch hunt. Now anyone who disagrees with you should have their gun rights taken away because power-seeking authoritarian government types are somehow the paragons of mental health?

The only people losing their gun rights for suspected mental illnesses are military veterans who've waived many of their rights to begin with and they are understandably upset about this.