If the judge expects to try him as an adult for the reasons I listed, then they're going to put him in an adult jail.
If the judge expects to try him as a juvenile for the reasons I listed, then they're going to put him in a juvenile jail.
Either way, someone does have to make the call. And there are circumstances where the call that was made is appropriate.
Since it's 'detention pending trial', if he gets acquitted or charges dropped then per the system he 'suffered no penalty'. Same as anyone else arrested and put on trial. We know that isn't true though, since anyone in jail is still in jail and jail sucks. If he is found guilty, then he gets transferred.
Clearly it was a bad call on the Judge's part doing what they did, which is why it got reversed - eventually.
But as anyone who has dealt with the courts is well aware, everything is glacial - unless it's going to make your life a pain in the ass. That usually happens quickly.
But like everyone else, one you're in the system, you're going to have a bad time regardless.
What else do you propose is going to happen though?