An ironclad law of public policy is that entitlement programs always grow faster and cost more than their creators intended.

Take Medicaid. It was tacked on to Medicare legislation in 1965 almost as an afterthought. The goal was to provide medical care to the truly needy. Federal and state governments would split the costs.

Unfortunately, Congress structured Medicaid in a way that guaranteed huge increases in spending from year to year. Medicaid offers states and beneficiaries perverse incentives to spend as much as possible.

Anyone who meets federal eligibility criteria (or a particular state’s broadened criteria) is legally entitled to medical benefits, even if they could access care and coverage elsewhere.

This leads to what Medicaid observers call “crowd-out.” Medicaid’s “free” coverage encourages employers of low-income workers not to offer insurance, and encourages low-income workers not to take private coverage.

Over a dozen studies have found that expanding eligibility for Medicaid reduces the number of low-income Americans with private health insurance. Some studies suggest that increased Medicaid enrollment is completely offset by reductions in private coverage.

Many beneficiaries go to great lengths to remain eligible for Medicaid by avoiding constructive behaviors — earning, saving, and purchasing private insurance — that would render them ineligible. Who would go out of their way to save for private health coverage when Medicaid is offered to them for “free”?

Medicaid also gives states an open-ended entitlement to federal matching funds. States receive an average of $1.30 from Washington to match every dollar they spend, which encourages them to broaden their programs.

These and other perverse incentives combine to encourage Medicaid’s out-of-control growth. According to the National Association of State Budget Officers, Medicaid has eclipsed elementary and secondary education as the most expensive item in most state budgets.

A more subtle measure of Medicaid’s excessive growth is this: According to the Urban Institute, 21 percent of eligible adults and 27 percent of eligible children have private health insurance. Clearly, Medicaid is no longer targeting just the truly needy.

The cure for this metastasizing program can be found in the 1996 welfare reform law.

In important ways, Medicaid resembles the old welfare program Aid to Families with Dependent Children (AFDC). AFDC encouraged the poor — and the not-so-poor — to become dependent on government and behave in ways that increased the cost of government. And it encouraged states to get more people to join those ranks.

Welfare reform changed that dynamic. Congress eliminated the open-ended entitlement to benefits, capped federal payments to the states, and gave states more flexibility to pursue a few broad goals. Caseloads plummeted by half and poverty decreased dramatically. In the face of dire predictions, welfare reform worked.

Congress should use a similar approach to tackle Medicaid’s flaws. First, it should eliminate the federal entitlement to Medicaid benefits. Second, Congress should stop encouraging Medicaid expansions, by freezing payments to states at the 2005 amount. According to Congressional Budget Office figures, freezing federal Medicaid spending at 2005 levels would produce $735 billion in savings by 2014.

Finally, the federal government should give states maximum flexibility to meet a few broad goals for Medicaid. States then could target medical assistance to the truly needy, reduce dependency, cut down on crowd-out of private insurance and charitable care, and promote competitive markets for medical care and insurance.

Each state would be free to structure its Medicaid program as it sees fit. Different states could try different benefit schemes for different types of beneficiaries, and experiment with health savings accounts, among other options.

Much like the old welfare system, Medicaid harms many that it purports to help by drawing them into a cycle of dependency. It bloats state budgets, raises the tax burden on all Americans, and makes health care much more expensive.

Last time around the critics said that reform wouldn’t work. They were not only wrong, but embarrassingly wrong — and the reformers managed to change the country for the better. That should give enterprising members of Congress reason to punch ahead.