Leviticus 20:21

And if a man shall take his brother’s wife, it is an unclean thing: he hath uncovered his brother’s nakedness; they shall be childless.

Taking a man's brother's wife is a transgression of God's law and an unlawful relationship. When the husband is still living, that taking is unclean. John applied this prohibition to Herod's marriage to Herodias, into which Herod could not enter without defying the law.

While remaining in that union Herod could have no part in and could not enter the Messiah's kingdom, but had to break from it and obey God's commandments. That breaking away and obedience had to be wholehearted. He chose sinful pleasure rather than obey the law. He refused to give up the marriage.