The first thing to remember is that they call it the worlds oldest profession, it has been going on since there was sex and something to trade for it. Nothing has eliminated it, and most countries historically just formalised it in the form of marriage. (It was one component of marriage not the only basis).
In most "western" democracies prostitution is illegal.
Yet making prostitution illegal is silly, a throwback to the old world where
More and more countries are legalising prostitution as this reality hits home that the world has changed.
But for some reason where they intersect that has become illegal. See diagrams below.
You can have any sex with anyone consenting and eligble, no matter:
So you can have sex with them if it is implicitly for money or resources.
But you can't have sex with them if it is explicitly for money or resources.
The reason for having sex can be anything you want in the world like
But you just can't do it for money, even though influence can get you money
So in summary you can do just about anything you want when it comes to sex, except pay, or be paid for it explicitly. The reason for being able to do what you want is it is you body, or your money.
But put the two together and its not your body or money, someone else has rights to it.
All sex work should be decriminalised and EXISTING legislation (eg Health and Safety Acts) used to protect sex workers.