For laws to be legitimate, they have to reflect the views and morality of the society they are intended to control. It's difficult for extreme laws to continue in a democracy without support from its electorate.
In the US, support for the death penalty is treated as a litmus test for being a "true conservative". What keeps it in place is the tribalism in the two party system that we have here in the US. The most conservatives states tend to have the most executions because politicians in those states only face challenges from their conservative flank.
Until conservatives are able to find some moral backbone, we will continue to have executions in the US. I do give credit to Rand Paul for at least beginning to address the inherent injustice in the US justice system. It's a step in the right direction for the Republican party.