Twenty-one states have decided not to expand Medicaid under the Affordable Care Act. Politicians in those states argue that expanding Medicaid would be too expensive. As Bob McDonnell, the former governor of Virginia, put it, "Virginia simply cannot afford to become the bank for a federally designed expansion of Medicaid."

Along with two other economists, Craig Garthwaite and Matthew Notowidigdo, I recently completed a research project on the topic, and we released a working paper this past week. Our findings make it clear: McDonnell's argument is just plain wrong. Expanding Medicaid would not be expensive, not for Virginia nor for any other state.

Politicians opposed to the Medicaid expansion forget one thing: the uninsured still visit hospitals. And once there, more often than not, they cannot pay the bill. For those visits, hospitals end up providing care free of charge.

Those unpaid hospital visits add up. In 2012, hospitals provided nearly $50 billion in uncompensated care. Even in the huge, three-trillion-dollar world of health care, $50 billion is a lot of money. By comparison, it's over a quarter of all the money Medicaid gives hospitals each year.

My co-authors and I found that, on average, each uninsured person costs hospitals about $900 a year. That $900 is the cost of hospital visits for which the uninsured don't pay.

What does this mean for states not expanding Medicaid? The Kaiser Family Foundation has estimated that the Affordable Care Act's Medicaid expansion would cost those states a total of $6.25 billion. That's not a lot of money as far as these things go, because the law requires the federal government to pay for 90 percent of the expansion.

But our research suggests that, in states that do not expand Medicaid, hospitals will provide $6.4 billion in medical care to the uninsured. So, in the end, the money that state governments save by not expanding Medicaid is roughly equal to the money that hospitals in that state spend on the people who are uninsured as a result.

And it's not just hospitals that foot the bill. Hospitals may shift part of those costs onto everyone else by raising their prices. That would raise the premiums the insured pay each month.  Moreover, past research on Medicaid has suggested other benefits of an expansion. States that expand Medicaid end up having fewer personal bankruptcies because after a Medicaid expansion, the state's residents have to put fewer medical costs on their credit cards. Medicaid expansions have also been shown to improve overall access to healthcare and to reduce mortality.

In short, the money that states save by not expanding Medicaid is illusory---the state still ends up paying, just in a different way.

It is thus no surprise that states are gradually changing their mind on the Medicaid expansion. So far this year, Pennsylvania and Indiana have decided to expand Medicaid. And debate is still underway in many other states. A deal that makes this much sense should be hard to resist.

Gross is an economist and an assistant professor at Columbia University.