2 'When there is found in thy midst, in one of thy cities which Jehovah thy God is giving to thee, a man or a woman who doth the evil thing in the eyes of Jehovah thy God by transgressing His covenant, 3 and he doth go and serve other gods, and doth bow himself to them, and to the sun, or to the moon, or to any of the host of the heavens, which I have not commanded— 4 and it hath been declared to thee, and thou hast heard, and hast searched diligently, and lo, truth; the thing is established; this abomination hath been done in Israel— 5 'Then thou hast brought out that man, or that woman, who hath done this evil thing, unto thy gates—the man or the woman—and thou hast stoned them with stones, and they have died. 6 By the mouth of two witnesses or of three witnesses is he who is dead put to death; he is not put to death by the mouth of one witness; 7 the hand of the witnesses is on him, in the first place, to put him to death, and the hand of all the people last; and thou hast put away the evil thing out of thy midst.

Matthew Henry's Commentary on Deuteronomy 17:2-7

Commentary on Deuteronomy 17:1-7

(Read Deuteronomy 17:1-7)

No creature which had any blemish was to be offered in sacrifice to God. We are thus called to remember the perfect, pure, and spotless sacrifice of Christ, and reminded to serve God with the best of our abilities, time, and possession, or our pretended obedience will be hateful to him. So great a punishment as death, so remarkable a death as stoning, must be inflicted on the Jewish idolater. Let all who in our day set up idols in their hearts, remember how God punished this crime in Israel.