If you legalized drugs and prostitution, corporations would set up to provide you with those services, eventually driving the low-lifes out of business.
You are correct about the drug pushers existing because of government regulation. You cannot stop supply and demand. When the government tries to regulate the supply and demand of something too much, the price rises to the point where the rewards to organized crime outweighs the risk, bringing that element of society into the market to supply the demand.
Why not legalize them?
Prostitution absolutely definitely should be legal. I see no reason why if two people want to have a commercial transaction for sex, they should not be allowed to.
In theory, I'm in favor of legalizing drugs, but I'm not sure. Make no mistake about it, criminal gangs make literally billions of dollars from this trade. They exist because of the drug trade. However, the costs of legalizing hard drugs such as heroin may be much bigger than those promoting legalization claim. We should legalize pot tomorrow. Booze is a far worse drug than pot.