The comparison between the harlotry of Gomer and Israel is based on unfaithfulness to God. Gomer was unfaithful to her husband Hosea, just as Israel was unfaithful to God by turning to idols and false gods. Both Gomer and Israel abandoned their commitment and faithfulness, and turned towards immorality and ungodliness. The comparison highlights the gravity of Israel's sin and the severity of their punishment, just as Hosea's marriage was strained by Gomer's unfaithfulness. In essence, the comparison emphasizes the importance of faithfulness to God and the consequences of unfaithfulness.