Hundreds of thousands of Americans with serious mental illness sleep in jails, shelters and prisons on any given night. Fewer than 40,000 are in state psychiatric hospitals. This is largely due to a federal policy, the Institutions for Mental Disease Exclusion, which created a financial incentive for states to kick the mentally ill out of hospitals. The White House’s new budget proposes easing the exclusion. It’s the most important thing federal government could do to improve care for the seriously mentally ill.

The IMD Exclusion, part of the 1965 law that established Medicaid, prevents the program from funding care for mentally ill adults while they live in hospitals or even adult homes with more than 16 beds. It was intended to prevent the federal government from taking on care of the mentally ill, which had historically been a state responsibility. Many mistakenly believed that newly developed antipsychotic drugs and community mental-health centers would obviate the need for institutions.

It’s been a disaster. Before Medicaid was enacted, states paid for psychiatric hospitalization, and it was readily available. But states soon realized that if they kicked patients out of hospitals, Medicaid would kick in and pay half the cost of care. This “deinstitutionalization” continues. The country has lost more than 450,000 mental-hospital beds since the 1950s, 12,000 of them since 2005.

Rep. Eddie Bernice Johnson (D., Texas), a former psychiatric nurse, has introduced a series of bills to abolish the IMD Exclusion. Like President Trump, Democratic candidates Amy Klobuchar and Pete Buttigieg support the idea. Despite this bipartisan support, the proposal has stalled in Congress because of opposition from civil libertarians and mental-health advocates who continue to argue, despite the evidence, that institutions aren’t needed because everyone with mental illness recovers with proper support and wellness initiatives. Bernie Sanders opposes easing the IMD Exclusion, even as he promises to provide free health care for all.

There are also concerns about the cost of inpatient treatment. Community care is cheaper, but it doesn’t help everyone—and it didn’t reduce institutionalization. The number of mentally ill people in jails, prisons, shelters and hospitals in the 1950s was roughly the same as it is today. But the majority were in hospitals in the 1950s.