Sounds like some bad laws to me. Here in Ohio, if a person is adjudicated incompetent to stand trial, that person is ordered to participate in a competency attainment program. The degree of confinement is based upon the person's risk to society. And yes, the current allegations are a part of that determination.
We are facing a situation at work right now where law enforcement is complaining about juveniles not being detained for some fairly serious offenses, putting the blame right on our shoulders for sending them back into the community. What gets ignored by the press in all of this is laws that have been passed over the course of the last decade which have greatly eroded the juvenile system. Laws have been passed which make it illegal to put a kid in restraints in the courtroom (it hurts their feelings), reduced the ability of courts to sentence juvenile offenders to lock up for lower level felony offenses and most misdemeanors (90 days is now the maximum for a misdemeanor offense),and eliminating two state level detention centers and the only one for female offenders. At the same time, the Department of Youth Services is evaluating courts and cutting state funding for courts that put too many kids in lock up. My old court was looking at a $100,000+ cut for putting too many felons into lock up. Irony is that this will result in the loss of two probation officers, reducing the ability to supervise kids in the community, which will likely result in increased juvenile crime and the concurrent need for more either community supervision or lock up. Yet, it's not the legislature or state offices (the governor) that gets the blame. It's the courts who take the blame and who are stuck following bad laws.