The previous ordinance guarded a son from a capricious father. This one maintained the rights of parents whose son (or daughter, presumably) was incorrigible. While the problem in view was one of lack of respect for parents (the fifth commandment), the offense could result in the death of the child (the sixth commandment).
This case presupposes a long history of rebelliousness. The son had become a glutton and a drunkard (v. 20). That is, he had developed a lifestyle of deviant behavior. Before loving parents would take the step available to them in this law they would doubtless try every other measure to secure their son's correction. This was the last resort for the parents. This law withheld the right of parents to slay their children for rebelliousness while at the same time preserving parental authority fully.
Commenting on the terms "stubborn"and "rebellious,"David Marcus wrote the following.
"Both terms form a hendiadys to indicate a juvenile delinquent. Now when one examines how these terms are used in the Hebrew Bible one sees that they belong to the didactic vocabulary of biblical literature.235They generally connote disobedience, in particular in Israel's relationship to God. (The pertinent references may be found in Bellefontaine's article [see below] from which the present author has greatly profited.) For example, in Psalms 78:8 the generation of the desert is termed sorer umoreh[stubborn rebellious]. Isaiah castigates the people for being sorerand following its own way (Isa. 65:2). Jeremiah proclaims that Israel has a heart which is sorer umoreh(Jer. 5:23). Israel is portrayed as rebellious and disloyal, and in so doing repudiating its God and its relationship with him.236In like manner, the son, by being rebellious and disloyal, has repudiated his parents and his relationship with them. The authority of the parents has been rejected by the son since he has refused to obey them. The son, in renouncing his relationship with his parents, has effectively declared, if not by his words, then certainly by his deeds, what the adopted son in the Mesopotamian adoption contracts says when he abrogates his contract, I am not your son; you are not my parents' (Ibid., 17)."237
It may appear at first that God was commanding the Israelites to exercise less grace with their own children than He showed the whole nation. However, God had previously promised never to cut off His people (Gen. 12:1-3). The Israelites were to be God's instruments of judgment in many specific situations, as we have seen in Deuteronomy. The punishment of sinners, be they Canaanites or Israelites, for specific types of sin was imperative for Israel to fulfill God's purpose for her in the world (Exod. 19:5-6).
Parents should put their love for God above their love for their children.