The law is not a strictly logical system (this is usually a good thing, despite the common negative perceptions). Pornography was once illegal; then the interpretation of the law changed so that it would be considered "protected speech," unless it is being displayed in certain contexts. Prostitution is illegal in most of the USA, except for certain forms which are not illegal (e.g. it may not be illegal to have sex with your boss in exchange for a promotion).
"She's Not a Whore if She's an Actress"
I am told that in California it is illegal for someone to pay to receive sexual acts. However, it is legal to pay people to engage in sexual acts with each other as long as the person making the payment doesn't participate.
For the most part, the same legislators who would ban the latter would probably ban the former, but the former has (within certain bounds) been deemed, in the US, protected expression under the First Amendment.