Same reason anything else catches fire.
Fuel vapour plus an ignition source usually does it.
Switching the battery off simply reduces the number of live wires in the airframe to make that ignition source.
Switching the engine off reduces ignition sources too.
If you don't crash hard or fast enough to split fuel tanks badly (and especially not to throw the fuel around creating lots of vapour) there isn't going to be much of a fire anyway.