Leviticus 18:16

Thou shalt not uncover the nakedness of thy brother’s wife: it is thy brother’s nakedness.

The verse forbids a man to marry his brother's wife, and taking her while her husband is still living is unlawful. The uncovering of nakedness forbids men and women becoming sexually familiar outside the boundaries God established to protect the purity of His people. Such conduct is both a crime and a sin and must not be indulged.

Herod's marriage and connection to Herodias, his brother's wife, violated this prohibition and was unlawful. John told Herod that he could not share in or enter the Messiah's kingdom while remaining in that unlawful connection. He had to break from it and obey God's commandments wholeheartedly. Herod chose sinful pleasure rather than obeying God's law.