Which is worse: 100 innocent people being killed by the death penalty or 100 innocent people getting killed by murderers? This is the calculation that many underdeveloped countries have to look at.
Allowing a murderer to live in a country that doesn't have the means to support them will lead to additional suffering of the prisoner (due to less resources), additional suffering of those not in prison (due to additional taxes), and an additional risk to additional murders by the murderer (if they kill other prisoners, guards or escape).
It is easy for people in the first world to say we don't have the need to have the death penalty, but to tell the poorest they are too stupid to know better is kind of arrogant.
I would especially recommend talking to people in the most remote areas of the underdeveloped countries. They literally are unable to keep people in prison.
Over the past few decades, most areas have been solving these issues, but there are still a few areas where there is no alternative.