Problem: God commanded Hosea to “take yourself a wife of harlotry.” However, according to Exodus 20:14, adultery is a sin; and according to 1 Corinthians 6:15–18, to have sexual relations with a harlot is immoral (cf. Lev. 19:29). How could a holy God command Hosea to take a harlot as his wife?
Solution: Some scholars have attempted to avoid the difficulty by claiming this is an allegory. However, while God obviously intended this as a dramatic illustration to Israel of their unfaithfulness to Him (cf. 1:2), there is no indication in the text that it is anything but a literal event. How else could it have been such a forceful example to the wayward people of Israel.
Taken literally, there is no real contradiction with any other Scripture for several reasons. First of all, when God commanded Hosea to take Gomer, the daughter of Diblaim, to be his wife, Gomer may not yet have actually committed adultery. However, God knew what was in her heart, and He knew that she would ultimately be unfaithful to Hosea. This is similar to the angel of the Lord calling Gideon a “mighty man of valor” before he had fought a single battle (Jud. 6:11–12). God knew that Gideon would become a great leader in Israel even though he was not yet. God commanded Hosea to take a woman whom He knew would become a harlot. God commanded this as a picture of how Israel had committed spiritual adultery against Him. When God brought Israel out of Egypt, she was a brand new nation. She had not yet broken the covenant which God would establish with her in the wilderness. Just like Israel had committed spiritual adultery by worshiping other gods, so Gomer would commit physical adultery by having relations with other men. The relationship between Hosea and Gomer was an object lesson for all Israel.
Second, the passage does not condone harlotry. In fact it is a strong condemnation of harlotry, of both the physical and spiritual (idolatry) kind (cf. 4:11–19). The fact that the grave sin of idolatry is depicted as spiritual harlotry reveals God’s disapproval of harlotry.
Third, Hosea was commanded to marry a harlot, not to commit adultery with her. God said, “Go, take yourself a wife.” God did not say go in and commit fornication with her. Rather, He said marry her and be faithful to her, even though she will be unfaithful to you. Not only does this not violate the commitment of marriage, it actually intensifies it. Hosea was to be faithful to his marriage vows even though his wife would become unfaithful to hers.
Fourth, the command in Leviticus 21:14 to not marry a harlot was given to the levitical priests, not to everyone. Salmon apparently married Rahab the harlot (Matt. 1:5) from whose legal genealogy Christ eventually came. At any rate, Hosea was a prophet, not a levitical priest, hence, the prohibition to not marry a harlot did not apply to him.
Finally, the command in 1 Corinthians 6:16 not to be joined to a harlot is not a command never to marry a woman who was a harlot. Rather, the command is directed against those who were having sexual relations outside of the marriage relationship. But, Hosea did not have sexual relations outside of marriage. God commanded Hosea to marry Gomer and always be faithful to her.