I've wondered / thought this myself from time to time.
It's kind of like gasoline storage. To read the warning labels and some of the comments people have made in various forums I read, you'd think having any gas in any container in the garage is a recipe for disaster. Yet I remember having a gallon can of gas for the mower sitting in my parents' garage all the time, usually with the spout still in place and no cover on it. Sure, if you were right next to it you smelled something, but that was about it. And the mower was even sitting there, with gas in it. The cap on those old mowers we had never did seal terribly well. And don't forget the 10, 20 or 30 gallon fuel tanks on cars that get parked in garages. New cars are great at containing the fumes, but my old VW sure wasn't...!
Sure, storing a huge quantity would raise the risks, nor would I store gas right next to a water heater or furnace, or refill a mower inside the garage. In all the gas-started garage fires I'd ever heard of the one common factor was someone playing with or being stupid with gas. Spilling it, or something, to cause a large vapor cloud in a confined space.
I start wondering if that's the same issue with batteries. Heck, I had a deep-cycle marine battery for many years inside my apartment. Didn't treat it very well, either, now that I know how I should have been treating it. But it lasted a long time and never gave me any problems. I can see the issue if someone is (say) trying to house a bank large enough to take a suburban house off-grid inside an enclosed closet, but it does seem many go overboard with the concern.
Batteries gas while charging, especially equalizing. That's a given. But to have a fire / explosion risk with hydrogen gas is going to require a certain concentration of the gas. Hydrogen being so light, it's going to disperse pretty readily into the available space. Thus the question I wind up with is, what concentration is required for ignition, and just how likely is that concentration given X batteries in Y square feet? Add in other factors, like my garage is (most unfortunately, especially in winter) fairly well ventilated anyway, and it's even less likely.
This isn't to wave off the potential hazards - they do exist. I just frequently start wondering where the protections from real hazards end and the overbearing "we must protect the stupid from themselves" type regulations begin...