Eventually, he and his fellow residents banded together and refused to go. Move the patients back to central Boston, they insisted, and treat them at the community mental health center. Their small protest was part of a growing movement to close state psychiatric hospitals across the nation and replace them with community-based care.

Those hospitals had also arisen from a movement: In the mid-1800s, after visiting hundreds of almshouses, jails and hospitals and seeing the horrid conditions that most people with mental illnesses lived in, the reformer Dorothea Dix begged health officials to create asylums where those patients could be treated more humanely. The first such facilities were small, designed for short-term, therapeutic care, and functioned more or less as Dix had hoped they would. But as local officials began foisting more of their indigent populations onto the states, they morphed into human warehouses. By the time Dr. Sharfstein started his career, most of them held upward of 3,000 patients, often for years at a time.

Advocates of a community-based approach argued that even the sickest psychiatric patients deserved to live in or near their own communities, that they should be cared for in the least restrictive settings possible, and that with the right treatment (humane, respectful, evidence-based) the vast majority of them could recover and even thrive.

Kennedy’s bill was meant to enshrine these principles. The plan was to build some 1,500 community mental health centers across the country, each of which would provide five essential services: community education, inpatient and outpatient facilities, emergency response and partial hospitalization programs. Ultimately, the centers would serve as a single point of contact for patients in a given catchment area who needed not just access to psychiatric care but help navigating the outside world.

The law did not provide long-term funding to sustain these new clinics — just seed grants for planning, construction and initial staffing. The hope was that once those grants expired, states would step in with their own resources. But this thinking proved overly optimistic. Rather than invest the money saved through asylum closures on mental health clinics, most states spent it on other priorities, such as cutting taxes or shoring up pensions.

As the initial grants ran out, programs that had been designed specifically for people with serious mental illnesses shifted focus, Dr. Sharfstein says. Some turned their attention to patients with better health insurance than the indigent had. Others tried tackling an array of nonpsychiatric crises. Alleviate homelessness and food insecurity, the thinking went, and even the most seemingly intractable mental illnesses would all but disappear. “Obviously, there is inherent value in addressing social ills,” says Paul Appelbaum, a Columbia University psychiatrist and an expert on the intersection of mental illness and law. “But the concept of community mental health became diluted to the point that it neglected psychiatric treatment.”

Congress tried to revive the flailing Community Mental Health initiative in 1980, with a bill that would have more than doubled the federal government’s investment in Kennedy’s original plan. President Carter signed that bill into law, but President Reagan repealed it the following year. He replaced it with a block grant program that gave state leaders broad discretion in how they spent federal mental health dollars. “It was more or less the death knell for a national community mental health system,” Dr. Appelbaum says. “They spent the money on all sorts of things, including things that we already knew were not working.”