Categorical imperative. Make sex work safe, clean, and acceptable. More people are happy, more people are able to pursue work that they find enjoyable (yes, there are sex workers that do the job because they like it), and more people are able to pursue their work in a secure environment where their safety is a priority. Conversely, the social stigma (which leads to the discouragement of which you speak), would spread unhappiness and would bar people from choosing work which they find fulfilling. Therefore, logically, legalizing and regulating sex work is the superior course of action.