Mandatory insurances (that are mandatory to ensure victims get paid) are often required to pay even in such cases, but are then allowed to (try to) get the money back from the perpetrator. This protects the victim but not the perpetrator, eliminating the moral hazard.