God telling someone to marry someone who is currently practicing prostitution is wrong. For what fellowship has light with darkness?
I believe that marrying a prostitute was a sketchy idea, but not inherently wrong. Gomer was not another man's wife; God was not ordering Hosea to marry a married woman. What Gomer did to Hosea was inherently wrong, though. God knew it would happen, but he is not the one who commanded Gomer to commit adultery. And that is key. It was her choice.
God ordered Hosea to marry her to illustrate a point about his own People prostituting themselves to idols. Idolatry is spiritual adultery/prostitution.
Some other tidbits about this case:
1. The Torah only explicitly commands priests to marry virgins I believe. Hosea is not said to be a priest but a prophet. David was a prophet but was also not a priest just as an example.
2. Our modern standard of morality or cultural taboos have no bearing on the Torah. I know of people who think that eating organ meat from clean animals is somehow not kosher. But what they really mean is eating organs, skin, etc. doesn't sit well with their dietary preferences.
3. It's likely Israel at this point was in such a bad way that no court of law would have ordered prostitutes killed for defiling the land according to the Torah. So it's unlikely that Gomer could have been publicly executed by any godly form of community even if two or more witnesses ever caught Gomer in the act of prostitution. In the absence of sufficient witnesses which the Torah required, I believe God found an opportunity to prove a point to his People by showing her mercy through Hosea.