Why do we have to pay car insurance for other people's cars?

Why do we have to pay car insurance for other people's cars?

As I understand it, the car insurance we pay is to fix other cars and their drivers in case we hit them. I don't understand why the law requires that we must pay for others' protection. Why shouldn't everybody pay for his own protection? If car insurance is required for everyone, then it would make no difference anyway, and I think, it would make people more motivated to get insurance.

For example, if I pay $150/mo for car insurance, and if someone hits me who has no insurance and no money, then my car will look terribly even though I kept the law. This doesn't sound fair to me. If someone hits me, then their insurance should cover their damages and my insurance should pay for my damages. Why should I suffer a loss because they didn't keep the law?