Leviticus 18:27

(For all these abominations have the men of the land done, which were before you, and the land is defiled;)

The practices set out in the context are called abominations because the men of the land who were before Israel had done them, and by their conduct the land was defiled. The warning not to commit any of those abominations is laid upon both the native-born and the foreigner residing among them. Both are commanded to keep God's statutes and judgments and to refrain from such practices.

The former inhabitants who thus practiced them were the Canaanites, whose abominations defiled the land and brought God's judgment upon them. The same warning stands that God's own people can follow those corrupt practices and thereby become abhorrent to God.