The penalty in Leviticus for a couple of sexual sins is burning by fire (Lev 20:14; 21:9).  In these verses, the word for burning is doubled.

In fire, he shall be burned.

This matches the phrase “die death”, which refers to exclusion from the community. See Restitution and Exclusion This parallel suggests that burning connects to exclusion from the community, too.

I don’t believe that God advocates burning people to death, as that would be contrary to his nature.  So we need to ask the question.  Who or what is burned?  I assume it is not the person who sinned.  I presume that it was their home and possessions.  This was a way of cleaning up the spiritual mess after an offender had been excluded from the community.

Mother and Daughter

The case of the man taking a woman and her daughter is different from other sexual sins, because this man took the women into his house (Lev 20:14).  The same word “take” was used for Isaac when he took Rebecca into his tent and made her his wife (Gen 24:67).  This man had effectively married a woman and her daughter at the same time.  He took them both into his home and committed the sin there.  This gave the evil spirits the opportunity to establish a place in his home/tent.

Like other sexual deviants, he should be excluded from the community. However, the evil spirits he had attracted might stay in the house and become a threat to the community. For the other sexual sins, the man engaged with a woman outside his home.  The sexual liaison was most likely in another place where he did not have authority, so he could not give the evil spirit authority permission to dwell there. Since he did not have authority over that place, the evil spirit did not get permission to remain there. In these cases, excluding the sinner from the community was sufficient for spiritual protection.

When the man committed the sin in his own home, the evil spirit gained the right to remain there, because it had power over him.  So, in addition to being excluded from the community, his house/tent should be burned, so the evil spirits he had allowed into it would depart with him.

Priests

Priests had to be particularly careful about spiritual compromise. If they picked up evil spirits, they could bring them into the tabernacle.  That would create a serious spiritual vulnerability, as the tabernacle was supposed to be an evil-spirit free zone.

Priests had to be careful about who they married, so they did not compromise the holiness of the tabernacle (Lev 21:7,13).  They had to stay away from dead bodies, because an evil spirit might pass across to them (Lev 21:1).

When the daughter of a priest sold herself as a prostitute, she must have set up a place to ply her trade (Lev 21:9).  She might have used her father’s tent/home for here illicit actions. To provide spiritual protection for the community, the dwelling that she had used for this spiritually-compromised purpose would need to be burned, so that the evil spirits that she had invited in would depart with her.

Judah

The experience of Judah is not really relevant.  Tamar had pretended to be a prostitute after Judah mistreated her. She got pregnant to him.

About three months later Judah was told, “Your daughter-in-law Tamar is guilty of prostitution, and as a result she is now pregnant.” Judah said, “Bring her out and have her burned to death” (Gen 38:24)!

The incident occurred before the law had been given, so it is not an illustration of the implementation of the law.

Note also the law in Leviticus 20:14 refers to a man taking a woman and her daughter.  In this case, the woman had sex with a father and a son, which is a different situation.  The son was dead, so this incident did not occur at the same time.

Judah’s behaviour was despicable. He had married outside his people.   His sons offended God.   He then engaged with a prostitute.   This was bad behaviour. I am not sure why he wanted to burn Tamar to death.  I presume he was angry because his sin had been exposed and he wanted to cover it up.   His behaviour cannot be used as a basis for interpreting and implementing God’s laws.

Judah’s desire to burn Tamar to death was morally wrong.