Deuteronomy 20:17 "But you shall utterly destroy them"

Every person is influenced by his neighbors.

The seven nations that occupied Eretz Yisrael before the nation of Israel conquered it, were corrupt idol-worshipers.

HaShem did not want them to live among the Jewish people and lead them astray. Therefore, He commanded us to wipe out these nations entirely.