As notdeadyet mentions patients do not get to keep all of their legal rights while in an inpatient unit. I can get up and leave any building I choose (unless I am charged with a crime and held), psychiatric inpatients cannot. I can crack open a beer and drink it, or chain smoke a pack of cigarettes. Psychiatric inpatients can't. If it comes to it a psychiatric inpatient can even be physically restrained and medicated against their will due to an imminent threat (pro gun people, please give that a try when they are packing heat!), which would be battery otherwise. It is disingenuous to suggest that patients do not lose any of their legal rights, and as notdeadyet mentions this is done for safety's sake.
A question for the pro-gun people: if your close family member needed an inpatient stay would you prefer that they go to a unit where anyone can carry guns or one that is gun-free?
I should point out that I do see the logic in people wanting to carry a weapon for protection in some contexts (even though I disagree with it in most instances). I have owned and been trained in the use of multiple guns myself, though I never deluded myself into thinking I had them for self-protection. However, there is a big difference in a delivery guy carrying a pistol in a bad part of town and in a fragile 67 year old attending carrying a pistol on a locked inpatient unit where a homicidally psychotic individual could easily wrest it from them and do whatever they would like with a captive audience of patients and staff.
It is also worth noting that a situation where having a gun lets you stop an active mass shooter would be exceedingly rare. Common sense suggests it is much more likely that increased access to guns will lead to increased impulsive use of them during arguments, periods of intoxication, misidentification of family members or friends as home intruders, road rages, domestic disputes, etc.