Normally its considered legal to sell but not legal to buy.
Prostitution is primarily conducted by women, and this is a way for them to still seek protection and healthcare while still technically criminalising the practice.