Selling sex legal, but the purchase illegal
I know its sounds like paradox, but it goes about penalizing clients only and to prevent malpractices (like human trafficking, forced or child prostitution) in it
Such way of regulating prostitution is present in ex. Canada, France, Norway or Sweden
I used to support this, but have grown less inclined towards it after recent evidence suggests that the police continue to suppress prostitutes and most prostitututes themselves find the legislation a burden on their incomes and safety. Then again, most find the legal zones in the Netherlands and Germany equally nightmarish, so I suppose more research is required.
The root problem is destitution. If you make it so nobody can fall into poverty, then nobody people will be forced into prostitution to survive, and you can have a less “problematic” sex industry. But that would require broader shifts in the economy in general.