The death penalty has been a source of much debate among sociologists. Consider the pros and cons of capital punishment. Why might some cultures prefer the death penalty while others have outlawed it?
In essence, you have asked two questions here, each of which needs to be answered at length. I will answer the second of these questions.
According to the link below, the following countries have been in the top five in the world for most confirmed executions in any given year since 2005:
These are the only countries to have been in the top five in any of these years.
So what do these countries have in common? Some of them are very religious (Iran, Iraq, Saudi Arabia), some are moderately religious (United States) and some are firmly non-religious or even anti-religion (China, North Korea). Politically, there is one country that is clearly democratic (the US), one that is largely democratic (Pakistan) and others that are authoritarian to varying degrees. Thus, religion and political systems cannot really explain why these countries use the death penalty so much.
I would argue that the countries that continue to have and to use the death penalty are generally those that are most concerned with maintaining social order, often in a situation where there are threats (or perceived threats) to that order. This is why countries as different as China, the US, and Saudi Arabia can have the death penalty.
Many of these countries have severe problems maintaining social order. Saudi Arabia has worries about its Shi’ite minorities. Iran has a theocracy that needs to maintain order in a society that is angered by economic troubles and does not necessarily agree with the theocracy’s religious views. China has a rapidly changing society and a government that fears being overthrown. The United States is something of an outlier here, but many Americans do feel that the social fabric of their country is being pulled apart by things like immigration and a loss of traditional values.
One of the major purposes of the death penalty, from a sociological perspective, is to maintain cohesion in a society. When the death penalty is applied, it serves at least two functions. It can serve to intimidate people who would act in ways that society sees as deviant. However, it can also serve to reassure non-deviant people. It can reassure them that their society is serious about maintaining and enforcing the rules that most of the population adheres to. For these reasons, countries that are experiencing problems (or think they are experiencing problems) with social cohesion and social control are the ones that are more likely to retain capital punishment.
Capital punishment remains one of the most polarizing topics among sociologists and criminologists. The practical application of the death penalty is used by a minority of countries today; most countries have either outlawed it completely or allowed a de facto ban due to not using the option. The reasons for or against the death penalty are too numerous to mention in one salient piece, but there are at least five topics which seem to bear the brunt of the discussion.
The moral question of the death penalty is almost always raised in the discussion. Proponents of capital punishment argue morality is not simply based on religious standards, but exists as a conception of human existence and is a solely human experience apart from the animal kingdom. A convict, subject to the death penalty, has made their moral choice to act outside the moral fabric of society and violate the statutory laws. The consequence of death is a known consequence and therefore the person has chosen to accept the risk. The death penalty would only be immoral if people did not have the free will to choose their actions. Opponents to the moral question argue a governmental entity does not bear the responsibility to "play God" and end a human life it is designed to protect. People are flawed, thereby governments are flawed and it follows decisions of that government may necessarily be flawed. A proper moral decision cannot be based on error.
Deterrence and retribution also come into play when dealing with the death penalty. There must be some level of punishment. Supporters argue the death penalty is the logical conclusion of the hierarchy of punishment. The ultimate crime, such as murder, can only be punished by the ultimate punishment: death. Such a punishment serves to deter people from committing the crime. Those opposed argue the statistical number does not support the deterrent argument. They also claim retribution does nothing to add to the moral fabric or aid the public after the commission of the crime. However, it is hard to properly calculate for either side the true nature of deterrence because crimes not committed are by nature unaccounted for.
Irrevocable mistakes are inherent in any system. These are mistakes that cannot be undone and are a major concern for those who oppose capital punishment. It is not possible to retroactively undo a death. They reasonably point out the numerous convictions overturned of persons serving on death row awaiting execution. The death of one innocent person is too much. The opposition argues irrevocable mistakes are part of life and cannot overrule reason. There are irrevocable mistakes driving for example. A car crash cannot be undone, only mitigated, yet it does not stop people from operating vehicles on the roadway. It is an accepted part of driving and should be an accepted part of the criminal justice system, although all due diligence should be done to lessen the impact.
The operation cost of the death penalty versus life in prison is a constant struggle between both parties. The data can be skewed toward either argument, which makes this point very contentious. Proponents argue the upfront cost of death penalty cases as they make their way through appeals is greater than life without parole. However, the end cost of life without parole exceeds capital punishment and is only becoming more true as advanced life saving equipment and medical advancements increases the life expectancy. Additionally there are arguments against spending money on life without parole because it serves no greater purpose to society. The convicted will never be allowed to operate in society and removing the person via the death penalty essentially equates to the same thing on a moral level.
The final argument presented is the disproportionate numbers seen in death penalty cases. Minority groups appear to be adversely affected with higher representation than in the civilian population. Those opposed to the death penalty use this as a demonstration of the inherent racism or classism in the justice system. This reverts to the argument that the justice system is not fair and therefore immoral in the application of capital punishment. Pro capital punishment arguments point out the numbers may be due to increased crime in these groups rather than injustice.
The world is moving away from the death penalty as a punishment. The United States remains one of the most developed countries which still uses the practice, although in many states it is no longer utilized. When examining countries which still allow for the death penalty there is one binding factor: religion. The countries still using the death penalty are religiously based countries with strong ties to the moral fabric of religion. The United States bases the moral fiber on Judeo-Christian beliefs for example, and Saudi Arabia on traditional Islamic law. Other countries such as Thailand use tribal religious beliefs as the basis for the death penalty. Moderate countries where religion is not the central theme to the government have moved away from the death penalty for most cases.