Prostitution harms nobody (and hence should itself be legal); putting others' lives at risk is another story. I can't agree that it should be legal to shoot into a crowd as long as you're lucky enough to miss them all.
But the legality of prostitution wasn't the question. (Although, IMHO, it falls under the laws of private contract and should be legal)
Should government have the ability to punish a person for a 'crime' before it has been committed just because that person had the potential to commit it?