Sonia Adams, Jamycheal Mitchell's mother, and other family members wear shirts with his photograph. (Timothy C. Wright/For the Washington Post)

FOR WANT of an available bed in a state psychiatric hospital, Jamycheal Mitchell,a mentally ill young man in Virginia who shoplifted a soda and two snacks worth $5.05 from a 7-Eleven, wasted away behind bars for four months, all but ignored by jail staff who should have noticed his catastrophically deteriorating health. Incoherent, emaciated and filthy, he died in his cell in August. Police are now investigating.

Mr. Mitchell’s ghastly death, at age 24, is all the more senseless given that the closest state psychiatric facility, Eastern State Hospital, in Williamsburg, should have had a bed available for him.

In fact, of Eastern State’s fewer than 300 psychiatric patients, some two dozen faced no criminal charges and had been designated as ready for discharge even as Mr. Mitchell languished at the Hampton Roads Regional Jail. Despite that, those patients remained at Eastern State, occupying scarce beds while a judge repeatedly ordered Mr. Mitchell transferred from the jail to the hospital.

There are several causes for the gridlock at Eastern State, the largest state psychiatric hospital in Virginia, and other similar facilities around the commonwealth. One is a sharp spike in demand for beds resulting from legislation last year that compels state psychiatric hospitals to admit patients in the event of mental-health crises. Heavy demand is compounded by a shortage of options for the mentally ill who are no longer clinically required to stay in the hospital. In many cases, patients deemed ready for discharge remain stuck in the hospital because there is no suitable housing or care (including skilled nurses, social workers or psychiatrists) in their home communities. That reflects inadequate funding by state and local government.

In the latest census of Eastern State, in September, some 40 patients — more than half of whom face no criminal charges — were designated as “ready for discharge” for weeks and often months. Had they departed, a psychiatric bed and suitable treatment would have been available for Mr. Mitchell. Instead, he withered in jail, unconscionably neglected. In the account of fellow inmates and his relatives, as reported by The Post’s Justin Jouvenal, the horrors endured by Mr. Mitchell were Dickensian. He lost at least 36 pounds. He cast off his clothes and was often smeared with his own filth. He urinated on his cell floor. His legs swelled — “elephant like,” in the description of an inmate who worked in his cell block.

As Mr. Mitchell’s health declined, Judge Morton V. Whitlow of Portsmouth General District Court ordered him transferred to Eastern State. The judge issued the order May 21, and reiterated it May 29 and again July 31, in a court hearing after which Mr. Mitchell’s relatives were so stunned at his appearance that one of them, his aunt, begged jail officials to send him to the emergency room. Her plea was evidently ignored.

The mentally ill population has soared in jails across the United States as states, enamored of deinstitutionalization, have closed psychiatric hospitals. In Virginia, fewer than 1,300 beds remain in state psychiatric facilities, down from some 6,000 in the mid-1970s.

As Mr. Mitchell’s case illustrates, jails are ill-equipped to treat the mentally ill. Yet without adequate resources allotted for care in local communities, jails will continue to warehouse people who need help, not confinement.