Requiring medical coverage for all citizens is a legitimate part of the mandate of a government, in so far as health is both a public good and a basic human right. A prototypical formulation of the position can be found in the Canadian Charter of Rights and Freedoms which defines health as a basic human right. Although the Affordable Care Act doesn't go as far as the equivalents in other developed countries, it starts from the premise that health is a public good. First, just as we have fire departments because a fire in one place, if untreated spreads to other places, so infectious diseases spread and damage all people if there are not universal programs of vaccination and treatment. Next, the health of children and mothers affects all aspects of a country's future. Thus ethically, universal health care is a necessary public good.
On an economic level, people who do not have insurance are treated for free in emergency rooms. It is more expensive to treat diseases when they become emergencies than to subsidize preventive medicine (e.g. a mammogram which catches early-stage cancer is less expensive than treating later stages of cancer).