In Leviticus 18 we have prohibitions against pagan practices. God is setting them up as His people. God is creating a Jewish nation state and He does not want them like the pagan people of the land. Canaanite worship included pedophilia and child sacrificing and God does not want them doing those things. The whole chapter is, for the most part, about unlawful sexual relations. Leviticus chapters 18-22 are a call to holiness. Remember, Leviticus is named after the Levites and the Levites are the priestly tribe. God is holy and we must worship in holiness. Jesus became our perfect sacrifice.