You're making sure that when the gun is handled negligently and shoots someone (i.e. when you didn't realize it was loaded, or when you mistook your neighbor or child for a burglar, or whatever), that the financial consequence is covered.
Keeping guns around is risky, but right now society bears that risk, not the people who insist on keeping guns around.
But aren't criminal acts (i.e., criminal negligence) committed by the insured not covered by insurance?
As far as the comparison to cars, we require insurance for cars operated on public roads. Also with cars, the morbidity and mortality is overwhelmingly associated with accidents; with firearms, it's deliberate acts (either suicides or intentional shootings), neither of which would be covered by insurance.
I'm not sure I see what mandatory liability insurance is supposed to accomplish, since it would rarely seem to be applicable. The cost of the insurance, since it would likely rarely pay out, would seem to be too low to make gun ownership unaffordable (which would seem to be your goal, based on your earlier comment of "Sure, better get ready to buy a big insurance policy!").
Keeping guns around is risky, but right now society bears that risk, not the people who insist on keeping guns around.