I suspect it's illegal for a couple of reasons. For one thing, people tend to have a bee up their butts at any sort of sex that doesn't fit the "loving monogamous heterosexual relationship" mold. For another thing, having prostitution illegal lends itself very well to abusive and desperate situations (human trafficking, the abusive pimp, selling sex for drug money), which gives prostitution as a whole a bad image. People don't hear prostitute and think of a college-educated girl having generally-fun sex and making money doing it, they think of girls smuggled over the border and kept in brothel-prisons or junkies so desperate for money that they'll consent to anything.
It's actively enforced much like drugs are. Prostitutes of and serving the middle class seem to be mostly left alone. Prostitutes serving the poor and the very rich get more legal attention, the first because streetwalkers are obvious and they have fewer resources to keep themselves safe and the latter because anything having to do with rich people and sex has instant media appeal.