The problem is that you can't keep them confined indefinitely without a continuing series of court findings that they are still dangerous. Even when confined, the authorities are bound to keep working towards releasing them. The holding facilities basically just melted away over time. The case which started it was O'Connor v. Donaldson in 1975. Here's the Wiki on it...But I don't believe there's anything from SCOTUS that prevents a mentally disturbed minor who is an imminent danger to themselves or others (pretty much universal criteria/requirement for admittance these days) from being admitted with authorization from their parents. We just don't have the capability to care for this population properly - with the goal being stabilization and discharge to outpatient care.
Or am I missing something?
Wiki