The beauty of drug dealing (from a criminal's perspective) is that it's easy and profitable - there's a high demand from customers willing to spend a lot of money on drugs, and enforcement is very poor (judging from the ease end-users can buy drugs). Prostitution is very similar. So, if you legalize all businesses with which criminals easily earn a lot of money, a lot of them will be economically incentivised to start participating in legal businesses.