As I don't live in the US, I'm not well versed in your criminal justice system. But telling from the news, Wiki articles on famous trials, and close parallels between the US and CDN judicial system (though Canada's is more liberal and slow), here's what I think:
The cops, politicians, government, and people want closure on things. It doesn't matter if someone likely committed a crime or not, there must be a scapegoat. This is what makes the police and their governments "accountable" to the people. It's not fair as you say, but what can you do? As a citizen of the US, you must submit to its legislation, good and bad. Perhaps let it be a deterrent to would-be criminals that they may get slammed regardless of severity of crime. If there were a bunch of open cases and no suspects on trial, case reports with the police, jails, manpower and time would be spread thin, people would complain, and thus "accountability" would be lost. That and taxes going up to pay for more investigators, or inability to tend to new cases because the last are still "open".
At the end of it all, everyone is out to protect their own jobs, their own asses. A name must be put to the case, a name must be put to trial, a name must stamp the "close". It's sociological, without this sense of security and trust, citizens would criticize and eventually revolt for an "ineffective" government.
Secondly, like you said - determined by the mood of the judge. Assuming your buddy is in Georgia (I'm aware crime rates are particularly high in that state), the judge may be lazy/jaded and just want to throw them all away. He/she's probably heard many and lost faith long ago. Racial bias, regardless of how fair one wants to be and tells him/herself, will also be factored into play. You can't stop it, only prevent being put in the situation and give it a good fight if the law does get you.
Until the US reduces its debts (not for a long time) to hire more people (and allocate more time to each case), and people's attitudes change to force changes to your legal system, fairness does not exist.