The point is to minimize trafficking.
It's an economic argument. There's a certain number of men willing to buy prostitutes. And there is a certain number of women willing to sell sex. If the demand exceeds supply, sex traffickers stand to make money by filling in the gap by forcing women to prostitute.
When you straight up legalize prostitution, the number of men willing to buy prostitutes, the demand, increases (because there's no more risk of ending up in jail). And the number of women willing to prostitute, the supply, increases (because there's no more risk of ending up in jail). However, if the increase in demand is larger than the increase in supply, that can create an even larger gap for sex traffickers to fill with forced prostitution. So, legalization can actually cause more sex trafficking, not less.
And, empirically, that's what
the data has shown. A number of European countries, most notably Germany, have recently legalized prostitution and found that it hasn't helped with issues like sex trafficking, abuse, etc.
So the theory is this. Maximize the number of willing prostitutes (the supply) by making it legal to sell and minimize the number of John's willing to buy (the demand) by criminalizing purchasing. This will ensure the smallest gap between (voluntary) supply and demand, which leaves the smallest window for sex traffickers to profit.
Sweden has implemented this counter-intuitive strategy and has had some promising results.