In the United States, there is a very clear commitment to justice prevailing in the court of law. There are many individual pieces of doctrine that are meant to prevent undue haste in any case that is presented and others that make it so that people are given a second chance to provide a defense for their case. Defendants have every chance to prove their innocence.
Since the court of appeals exists anyone who feels that they have been treated unfairly or been given the wrong sentence when they finish with going through court the first time gets a chance to return to court again. The hope is that any wrongful convictions can be sorted out in appellate court so that no one is wrongfully imprisoned. Of course, mistakes are sometimes made.