Deuteronomy 20:18

18 Kill them, so that they will not make you sin against the Lord by teaching you to do all the disgusting things that they do in the worship of their gods.

Deuteronomy 20:18 Meaning and Commentary

Deuteronomy 20:18

That they teach you not to do after all their abominations,
&c.] This is another reason why they were to be utterly destroyed, not only because of the abominations which they committed, but to prevent the Israelites being taught by them to do the same; wherefore, as before observed from Jarchi, such as became proselytes were suffered to live among them, because there was no danger of idolatry from them, which even proselytes of the gate renounced; and though all other abominations are included, yet this is particularly respected, as appears from the following clause:

which they have done unto their gods;
to the honour of whom not only many superstitious rites and ceremonies were performed, and idolatrous actions committed, but acts of lewdness, and even unnatural uncleanness:

so should ye sin against the Lord your God;
a sin the most provoking to him, as the sin of idolatry was; and cause his anger to rise to such a degree, as to suffer them to be carried captive from the land he gave them to inherit; and which afterwards, was the case, and that through learning the manners and customs of these people; see ( Psalms 106:34-42 ) .

Deuteronomy 20:18 In-Context

16 "But when you capture cities in the land that the Lord your God is giving you, kill everyone.
17 Completely destroy all the people: the Hittites, the Amorites, the Canaanites, the Perizzites, the Hivites, and the Jebusites, as the Lord ordered you to do.
18 Kill them, so that they will not make you sin against the Lord by teaching you to do all the disgusting things that they do in the worship of their gods.
19 "When you are trying to capture a city, do not cut down its fruit trees, even though the siege lasts a long time. Eat the fruit, but do not destroy the trees; the trees are not your enemies.
20 You may cut down the other trees and use them in the siege mounds until the city is captured.
Scripture taken from the Good News Translation - Second Edition, Copyright 1992 by American Bible Society. Used by Permission.