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 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.