In theory, the death penalty is a fine thing. Certain crimes are so heinous that the people who commit them do not deserve to live. But the problem comes in the administration of the death penalty.
Some crimes deserve death. But which ones? This question ends up coming down to a jury or perhaps a judge. In either case, fallible human beings are making the choice of life or death. When this is the case, all sorts of prejudices can come into play.
For example, it is well-known that blacks who murders whites get the death penalty at a higher rate than any other racial combination. Could this be due to prejudice? It is likely that other prejudices come into play as well. A person who kills a well-loved member of a nice family is going to look worse in the eyes of the sentencer than someone who kills a rival gang member, even if it is in cold blood. In other words, killing a more sympathetic victim is likely to get the death penalty more often than the killing of someone else, even though the crimes are morally the same.
So while the death penalty is fine in theory, there are clearly problems with administering it fairly.