First, where do you draw the line? Do we deny 2nd Amendment rights to any person who has ever seen a therapist or counselor?
Second, not all those suffering from mental illness are violent people. A very small percentage are capable of one of these horrible mass killings. Many are responsible gun owners. How many people who need psychiatric treatment do not seek it out for fear of losing their right to carry a firearm?