This probably doesn't surprise you. But, it bears mentioning that the conditions of jails and prisons in Africa is often miserable. Hat tip to Talk Left.
Also, just for good measure, I will also note that Africa has a huge number of non-democratic or marginally democratic nations, that it the scourged by civil wars of catastrophic scale in terms of human harm, that there are a number of African countries where more than 10% of the population has HIV, and that this short list only scratches of surface of Africa's many woes.
The United States does not have the best system of criminal justice, or a lot of other things, in the world. But, it certainly does not have the worst.