Actually, you're totally right, health insurance is a lot like car insurance: if you do not have the money to buy it, or simply don't want to spend money on it, that is not only potentially harmful to yourself, but also to others, which is why making it obligatory to get kind of makes sense. Besides the admittedly rare cases of sick untreated people (due to their lack of health insurance) infecting others, there's also the considerable cost to society of having to treat people in ERs who might've been treated in a much cheaper fashion if they'd had insurance allowing them to go see a doctor at an earlier stage, and the even larger cost to society of missing out on the contributions of people who die early or become unable to work due to medical reasons that might've been avoided if they had had insurance to get treatment earlier on. Medicare is really pretty retarded in that sense - fortunes are spent on some people's health once they turn 65, because they couldn't afford comparatively cheap treatment earlier and things got worse and worse, then at 65 suddenly the government makes it its business to do something about it.
And specifically in the case of the United States, where health insurance is so strongly linked to one's employment, there is yet another cost in the sense that people are often prevented from making the employment choices that they would like to make, and where they would be more productive (become an entrepreneur, work for a small local company rather than a big one, quit some job that's making them depressed,...), because they can't afford to lose their health insurance.
I'll add in closing this cliché but still kind of mind-boggling statistic: the USA's public spending on health care, as a share of GDP, is higher than that of most European countries which have universal socialized healthcare. Not even talking about the private spending, which is much higher still in the USA, and very limited in most of those other countries. And yet Americans live (slightly) shorter, have (slightly) higher child mortality rates, and so on. For a country that supposedly doesn't want socialized healthcare, the US certainly manages to spend an astonishing amount of taxpayer money on it, without even getting the results you'd expect.