The Hospital provides you with the means to heal the units slain when defending your city on the Wall. The Hospital becomes available at Citadel level 15, and you can build up to 3 Hospitals in your city.
Upgrading the Hospital increases the amount (weight) of units that can be healed when slain on the Wall. Units stationed at the Hospital do not count in the total capacity of your city. Generally, healing units is considerably faster and cheaper than recruiting new ones.
N.B. Keep in mind that units obtained as reinforcements from the Embassy cannot be healed, and will be lost if defeated.
You can construct the Pharmacy module in your Hospital, which reduces the costs to heal units (in gold).