I don't have an answer to the problem you describe. Defense attorneys attempt to defend guilty clients. But the prosecution and police also will attempt to convict someone who is innocent. Check out this thread, DNA Exonerates Man Jailed in 1984.
I'm not suggesting that they do this on purpose, at least most of the time. A few cases of prosecutorial and police conduct have occurred, but those are exceedingly rare.
What I am suggesting is that the adversarial system is the best system we can come up with. We can't let some "independent panel" be the investigator, judge, and jury. That is a grave threat to all of us.
The current system results in more guilty people getting off than innocent people it convicts. It's frustrating, but there has to be some satisfaction the system does result in the overwhelming percentage of people charged with a crime being found (or pled) guilty.
It's the exceptions that drive us nuts.