171 Thou shalt not sacrifice unto Jehovah thy God an ox, or a sheep, wherein is a blemish, [or] anything evil; for that is an abomination unto Jehovah thy God. 2 If there be found in the midst of thee, within any of thy gates which Jehovah thy God giveth thee, man or woman, that doeth that which is evil in the sight of Jehovah thy God, in transgressing his covenant, 3 and hath gone and served other gods, and worshipped them, or the sun, or the moon, or any of the host of heaven, which I have not commanded; 4 and it be told thee, and thou hast heard of it, then shalt thou inquire diligently; and, behold, if it be true, and the thing certain, that such abomination is wrought in Israel, 5 then shalt thou bring forth that man or that woman, who hath done this evil thing, unto thy gates, even the man or the woman; and thou shalt stone them to death with stones. 6 At the mouth of two witnesses, or three witnesses, shall he that is to die be put to death; at the mouth of one witness he shall not be put to death. 7 The hand of the witnesses shall be first upon him to put him to death, and afterward the hand of all the people. So thou shalt put away the evil from the midst of thee.

Matthew Henry's Commentary on Deuteronomy 17:1-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.