The wikipedia article is not clear:
Prostitution was common in ancient Israel, despite being tacitly forbidden by Jewish Law.
What was the law forbidding prostitution? Given that prostitutes could take professional disputes to court, what was the legal role of prostitution?
I can't simply google up this type of question. This question is controversial due to it's political significance.
Most sober historians would argue that, as some of the comment says, that the Torah only prohibits cult prostitution and not regular entrepreneurs.
Most "born again" Christians would argue that it's always been illegal.
Also what constitute marriage and prostitution may differ in ancient Israel than what's now.
Now, we probably decide based on 2 things. Whether the marriage is registered at the state and whether an explicit contract of sex for money is involved.
I bet ancient Israelites do not differentiate marriage and prostitution that way. I bet most "marriage" in ancient culture is never registered officially anywhere. Perhaps they think promiscuity is the issue?
So the answer to this question is pretty "nuanced"
I asked in history stackexchange because I want a more sober objective answer. I bet laws in ancient Israel isn't much different from laws in pretty much most ancient culture. And perhaps we can make more educated guess on that.