Chapter 18 of Vayikra (Leviticus) mostly deals with various forbidden relationships, but without specifying the individual punishments for transgressing them (just a collective warning to the nation that tolerating such behaviors will cause them to be "vomited out of the Land," and a brief mention of kareis for the perpetrators).
In ch. 20 the list is repeated (with variations in the ordering of the various relatives), and with penalties specified for each one - some court-imposed punishments, others Divine ones.
In between, in ch. 19, is a miscellany of mitzvos (Rashi to 19:2, citing Sifra, characterizes it as a section on which "most of the fundamental teachings of the Torah are dependent"), starting with "Kedoshim tihyu" - "You shall be holy" (which Rashi explains as meaning: "Separate yourselves from sexual immorality and from sin," and Ramban as saying: "Sanctify yourself within the permissible" - i.e., don't indulge your appetites just because the food or whatever is kosher).
Why this order? I'd think that chs. 18 and 20 should be juxtaposed, with ch. 19 either preceding or following them.