I know you gave your reason. What moral standard? But if certain acts are judged  heinous enough by society to warrant the forfeiture of the violator's life, it is not immoral. People know the law and if they do acts that warrant the death penalty it's their fault not that the law or society is immoral.