Leviticus 18:28

That the land spue not you out also, when ye defile it, as it spued out the nations that were before you.

The land itself reacts to moral defilement by expelling its inhabitants, and abominable practices bring that judgment of expulsion upon whoever commits them. As the land cast out the nations that occupied it before Israel because of their corruptions, so it would cast out Israel also if Israel defiled it in the same way. The fate of the Canaanites therefore stands as a standing warning that God's people must not adopt their practices. To follow that corruption is to invite the same result, with defilement inevitably followed by being spewed out of the land.