Why does the innocent sometimes pay for the guilty?

Sometimes i does ask my self why the innocent has to pay for the guilty? In 2019 the court of first instance wrongfully convicted a innocent person to prison for 18 years for murder which everyone knows he did not commit and the actually killer is on the street’s enjoying his life and he has the innocent person in prison doing his time the poilce accused him for killing j.c the 6 of August 2018 cause when they arrested him he was in possession of the decesed phone which he got it from the killer who gave him the phone to unlock.