Deuteronomy 20:18

18 so that they may not teach you to do all the abhorrent things that they do for their gods, and you thus sin against the Lord your God.

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 as for the towns of these peoples that the Lord your God is giving you as an inheritance, you must not let anything that breathes remain alive.
17 You shall annihilate them—the Hittites and the Amorites, the Canaanites and the Perizzites, the Hivites and the Jebusites—just as the Lord your God has commanded,
18 so that they may not teach you to do all the abhorrent things that they do for their gods, and you thus sin against the Lord your God.
19 If you besiege a town for a long time, making war against it in order to take it, you must not destroy its trees by wielding an ax against them. Although you may take food from them, you must not cut them down. Are trees in the field human beings that they should come under siege from you?
20 You may destroy only the trees that you know do not produce food; you may cut them down for use in building siegeworks against the town that makes war with you, until it falls.
New Revised Standard Version Bible, copyright 1989, Division of Christian Education of the National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved.