The passages instruct the nation regarding sexual ethics; the nation must not conduct themselves in the same manner as the pagans around them. For example, the Hittites allowed incest and bestiality. The Canaanites promoted temple prostitution. The Egyptians had no rigid form of sexual morality. Conversely, the nation of Israel was called to be holy in their sexual conduct.
3 You shall not do as they do in the land of Egypt, where you lived, and you shall not do as they do in the land of Canaan, to which I am bringing you. You shall not walk in their statutes.