Most of the problems associated with prostitution are caused by the illegality itself. If it were legal, you wouldn't have hookers walking down the street soliciting you. They would be in "cathouses" in areas zoned for such businesses. Rather than offering STD testing, it could be mandated as a requirement for their license. You would no longer have pimps beating them. And they would be paying income tax and their employers would be paying business taxes.
Where I live, the Netherlands (small country in Europe, you probably know Amsterdam), prostitution is legal. But legalizing prostitution alone hasn't been enough to solve all the problems and criminal connections. Prostitution remains easy money for criminals, especially when prostitutes are forced and get little pay. And the real-estate needed for window-prostitution and brothels is a good way to launder money. There remains a substantial part in illegality, though overall, the situation seems better in comparison to places where prostitution is illegal.