Matt 5:38, 39 has nothing to do with the death penalty nor any other legal punishment. It is discussing the Christian attitude to retaliation and revenge. This Christian ethic is taught in other places in the Bible such as:
- Deut 32:35, 36 - Vengeance is Mine; I will repay. In due time their foot will slip; for their day of disaster is near, and their doom is coming quickly.” For the LORD will vindicate His people and have compassion on His servants when He sees that their strength is gone and no one remains, slave or free.
- Rom 12:19 - Do not avenge yourselves, beloved, but leave room for God’s wrath. For it is written: “Vengeance is Mine; I will repay, says the Lord.”
- 1 Thess 4:6 - and no one should ever violate or exploit his brother in this regard, because the Lord will avenge all such acts, as we have already told you and solemnly warned you.
- Heb 10:30 - For we know the One having said, "Vengeance is Mine; I will repay," and again, "The Lord will judge His people."
- Luke 18:7, 8 - Will not God bring about justice for His elect who cry out to Him day and night? Will He continue to defer their help? I tell you, He will promptly carry out justice on their behalf.
Thus, Jesus' teaching in Matt 5:38, 39 is in contrast and contradistinction to the commonly held view ("you have heard it said that ...") that every wrong should be humanly avenged. Christians await for God to do the righting of wrongs.
Ellicott astutely observes:
Turn to him the other also.—We all quote and admire the words as painting an ideal meekness. But most men feel also that they cannot
act on them literally; that to make the attempt, as has been done by
some whom the world calls dreamers or fanatics, would throw society
into confusion and make the meek the victims. The question meets us,
therefore, Were they meant to be obeyed in the letter; and if not,
what do they command? And the answer is found (l) in remembering that
our Lord Himself, when smitten by the servant of the high priest,
protested, though He did not resist (John 18:22-23), and that St.
Paul, under like outrage, was vehement in his rebuke (Acts 23:3); and
(2) in the fact that the whole context shows that the Sermon on the
Mount is not a code of laws, but the assertion of principles. And the
principle in this matter is clearly and simply this, that the disciple
of Christ, when he has suffered wrong, is to eliminate altogether from
his motives the natural desire to retaliate or accuse. As far as he
himself is concerned, he must be prepared, in language which, because
it is above our common human strain, has stamped itself on the hearts
and memories of men, to turn the left cheek when the right has been
smitten. But the man who has been wronged has other duties which he
cannot rightly ignore. The law of the Eternal has to be asserted,
society to be protected, the offender to be reclaimed, and these may
well justify—though personal animosity does not—protest, prosecution,
punishment.