Both Leviticus 20:14 and Leviticus 21:9 are part of the civil law under which the nation of Israel lived and operated. The penalties discussed here are capital punishment by fire-probably burning at the stake. In our culture, this would certainly be considered a primitive method. However, some have commented that it was actually much more humane than stoning or crucifixion. (People burned at the stake die very quickly from asphyxiation because of lack of oxygen in the flames).
The sins covered in these chapters were considered very grievous. Sins involving the priests or their families because of their sacred calling and responsibility for being right examples were especially offensive. Sins of sexual immorality were also very serious. God chose to use the metaphor of a pure and holy marriage as a metaphor for His relationship with his people. He (Christ) is the bridegroom and the Church (His people), the bride. Sexual immorality and perversion is especially offensive when thought about in this context. These kinds of sins were firmly dealt with in the nation of Israel during Old Testament times. (Capital punishment was quite common for a wide variety of violations including Sabbath breaking. See Numbers 15:32-36.)