If we have an imperfect judicial system then we have NO choice but to err on the side of the potential innocent.
Even God, when confronted by this scenario, as argued by Abraham in Genesis 18:22-33, decided to err on the side of the innocent since to do otherwise may have brought harm to those who had done nothing to deserve it.