the fuel tank is protected by the entire length of the car , while the Tesla's battery is only minimally protected despite it's more exposed position to such hazards.
When you run over something, it's pretty much up to chance as to what it hits under your car, how it tumbles, when it gets flicked up, and what gets punctured as a result.
Also considering that the lithium battery is self contained , and not particularly explosive as such, and tends to (from what we've seen) burn in-situ and not spread fuel all over the place if punctured.... the two methods of energy storage probably come out equal.
Sure, things might be better if the batteries were more centrally located. And things might be better if all liquid-fueled cars used the F1-style fuel bladders to keep fires to a minimum during accidents, but here we are.