Remember it is better NOT to visit if ill or suffering from a fever. Don't risk carrying additional illness or added risk to someone in the hospital.
If a spouse wants - or feels it is necessary to spend the night - ask the staff. In many cases, provisions can be made to allow this to happen. Some facilities provide folding beds, chairs that make out into a temporary bed, or even rooms for family members to stay.
Respect for the facilities simple rules will make a hospital stay easier for everyone involved, from the patient to the family to the staff. Mutual respect and adherence to rules works