It is not illegal in Washington if it is not a secured mental health facility:
RCW 9.41.300, prohibited places:
(c) The restricted access areas of a public mental health facility certified by the department of social and health services for inpatient hospital care and state institutions for the care of the mentally ill, excluding those facilities solely for evaluation and treatment. Restricted access areas do not include common areas of egress and ingress open to the general public;
Hospitals can have their own no firearms policy, which would be no different than a no guns sign at the entrance to a grocery store.