God didn’t choose the Israelites to belong to him because they were less sinful than other people groups. God set his love upon them, not because of their virtue, but simply because he chose to. God would make himself known to the world and bring glory to himself, by punishing the sins of His people, and by showing them his mercy.
And ultimately God would send them a Savior, from the tribe of Judah, a descendant of King David, who would give people of all nations access to the Kingdom of God. What God was commanding Hosea to do in miniature, take sinful Gomer as his wife, God had done in much greater magnitude, pledging himself to a sinful humanity.