I can't tie the corrosion to any particular environment. I have had one go bad stored in a box in a pantry and one go bad while hanging in a wall fixutre. Friends have lost them as well.
I do check the batteries on a regular basis and replace any that are suspicious.
Perhaps it is that when a battery starts to leak inside an aluminum tube, the aluminum itself speeds the corrosion process up.

There is something about the heft of a Mag Lite that makes you feel safe.