Even if you're not interested in forensic psychiatry, I'd encourage our readers to wander over to The Crime Report to read an article by my esteemed colleague Dr. Erik Roskes. He has written an excellent piece entitled "Sentenced to the Max Without Benefit of a Trial", about the role of prosecutors in the continued confinement of incompetent and unrestorable criminal defendants.
I can't do it justice in a nutshell, but briefly it's about criminal defendants who will never be well enough to go to trial. Although the law requires that charges eventually be dropped in these cases, in Maryland prosecutors are pushing the limits of the law to keep defendants in the hospital as long as possible. Amazingly, public defenders do not oppose or question this. As a result, increasing numbers of state inpatient beds are tied up by forensic patients who would otherwise be released if non-dangerous. (Dangerous incompetent patients could still be civilly committed even if the charges were dropped.)
This practice has recently been criticized in a Justice Policy Institute report published last year. Still, the practice continues.