This happens all the time in the US, especially for poorer/disadvantaged folks. They'll be advised to plead guilty whether they did it or not because they'll be given a lighter punishment + be done with it instead of missing more work going to court and possibly still being found guilty.
Hell I did it and i'm white middle class, but I was actually guilty too so...