That’s a rather cynical view of marriage - and, indeed, of sex in the context of relationships.
How about it? Girlfriends, do you give up the booty to your boyfriends for money or its equivalent? Husbands, do you sleep with your wives for money or its equivalent?
So one question that is evoked here is why would having sex with someone become illegal as soon as funds are involved? It’s not prostitution if someone has sex with a strange woman on the street, if he doesn’t pay her.
Also - someone once said about marriage - probably more eloquently than this, that the sex you pay for is inexpensive compared to the sex you get for free.
Laws on this vary widely by state, but it’d be illegal in many of them. For example, in Minnesota, sex between 2 unmarried people is illegal, “whether for a consideration or no”. So even if no money or other property changes hands, it’s still prohibited.
Of course, the police don’t generally try to enforce this too much.