Sheikh Salman al-Oadah
I hold the view that medical insurance is lawful for remedial purposes and for precautionary examinations. If taking out such a policy is obligatory by law, as you have indicated, then it is lawfulness is even clearer, because in this case this matter is treated as a legal necessity.
Likewise, if taking out an insurance policy is required by law for you to be able to drive, then it is lawful for you to take out a policy.
Even those scholars who say that insurance is categorically unlawful treat the matter as a legal necessity in cases like these.
And Allah knows best.
Source: Islam Today