That said, an independent judiciary is an important part of the separation of powers on which American government is based. While I personally find this entire thing reprehensible from soup to nuts, the judge's power to set arbitrary bail really is the way the system is supposed to work (the kid getting beat up in prison is not the way the system is supposed to work - except that plenty of Americans need a lot more civics education and actually do like to think of people getting raped in prison as extrajudiciary punishment for the suspicious).
Also, an indictment is not a ruling of guilt. A grand jury is convened to decide whether there's a case at all. I personally think this grand jury should have their citizenship revoked until they've passed a battery of examinations in what America stands for, but sadly, that's again not the way the system works.