You seem to be piecing together things that aren't necessarily related. The hospital/large-scale backup system thing and putting-batteries-in-the-ground thing aren't related, and here's why.
First of all, batteries absolutely should be kept at as constant of a temperature as possible. Both high and low temperatures affect batteries of all kinds, and lead acid batteries in particular as both liquid and gel electrolyte batteries have very reduced performance and high losses at low temperatures as well as high degradation rate due to dendrite formation at high temperatures.
Another good reason to put large batteries away in a place where you can't reach them easily is to avoid danger in case of an explosion or fire. Any concentration of energy in a small space, be it batteries or gasoline, is a hazard.
It's not necessarily a good rule to put them in the ground though. Ground water will cause leakage and corrosion. Animal life, large and small as well as plant roots pose a big risk for environmental contamination and unnoticed capacity loss. There are special underground containers for batteries, often used for pool installations and off-grid solar installations.
Now, as for your analogy with large-scale battery backups: these are put in the basement for one or more of many reasons, but not particularly for the constant temperature:
- Ease of refilling a battery-backed diesel generator nearby (you don't want to have to pump diesel onto the top floor of a building)
- Installation weight and weight area density (basement floors often have a much higher weight limit than higher floors)
- Basements are often unattractive or unusable floors for anything else but machinery or conversely: the other floors are too attractive for higher-value usage to 'waste' on infrastructure
- Backup systems often produce lots of interference - sound and electromagnetic
As already stated by Dirk Bruere, batteries are only really put into the ground in climates with low water tables and unfavourable outside storage conditions: very hot or very cold and dry. Because the ground is pretty much at a constant temperature starting about 5-6ft under, that's a good way to improve battery life.