Difficult subject. One good thing about not taking everything literally even in the Pentateuch is highlighted in the following note.
Note: When a member of the congregation in Corinth committed incest—one of the capital offences in Leviticus 20—Christ's apostle did not call for him to executed but to be excommunicated by the church. By God's grace, this was used to bring him to repentance and he was forgiven by the Lord and the saints, and restored to the congregation (II Cor. 2; 7). -- Rev. Angus Stewart.
Others that fall into the same chapter (Lev. 20) are adultery, same-sex acts and others. Can you imagine if all adulterers and homosexuals were suddenly to need capital punishment? You'd really bankrupt all of civilization. Who would be left to run things or to care for the children of the adulters? Terrible thought.
We live in more enlightened and kinder times.