There's no case from Old Testament law or Jewish regulations that prostitution is forbidden- a point scholars often make.
"Prostitution in the narratives and in the corpora is neither a criminal act nor an illegal activity," notes Irene E. Riegner.
“The Torah holds up monogamy as the ideal (Gen. 2:18–25), but no law explicitly prohibits sex with a prostitute outside the covenant,” as the more traditional Bible scholar Bruce K. Waltke puts it.
Remember that biblical law only ever concerns Israelites. Sex with any non-Jewish woman is fine. Their husbands can be killed to get them!
We just don't see the OT even thinking poorly of prostitutes. Rahab the Harlot is a major Jewish and Christian heroine. She is in the line of Christ. A curious designation for a disapproved figure.
Samson sees a prostitute (Judges 16:1). Solomon judges a conflict between two prostitutes in 1 Kings 3:16-28; they are never legally imperiled. It just doesn't seem to be an issue.
So when the term "prostitute" or zonah/zanah is used prophetic discussions, it's unclear there is any reference to 'sex work' as a human practice. This offense is a sacred violation involving relations between deities and nations. (Nations are seen as women in prophetic texts.)
Irene E. Riegner makes this study in "The Vanishing Hebrew Harlot". There's a summary at the very end.