To me, it seems like the system is working as intended. Rather well, actually, because a bad doctor was brought to light with a fairly benign case rather than something potentially deadly later on.
The prison (or juvenile hall) most certainly isn't.
Wait, no - it is about the system. There is obviously a problem if this is one of the acceptable outcomes.
How often does stuff like this happen, but we don't hear about it? Jails and prisons are human rights black holes.