Prostitution, it is said, is "the world's oldest profession", is abundant in many cultures, and in most cases concerns prostitutes who are (or pass as) female, and customers who are male. Going by the principles of economics, these facts betray a chronic and significant scarcity of females willing to have sex with males. Without such shortage, it would not be feasible to charge money for something as natural and simple as sex.
A long-standing debate pertains to the matter whether or not prostitution is ethical or ought to be outlawed. Some countries forbid it, some legalize it. Some thinkers call it a victimless crime, meaning it does not harm anyone and should be allowed. Sweden, followed by a few more Scandinavian nations, takes the cake: they criminalize the customers, but not the prostitutes!
To decide on the ethicality of prostitution, consider the following: The lack of available (willing) females implies that only those men who, to sufficient degrees, possess the features that women desire in the opposite sex, will have access to females outside the realm of prostitution. The rest, unfortunate as it may be, and without passing any value judgment whatsoever, are just the born losers who were not meant to have sex. Sad, perhaps — for them — but that is how nature and evolution work.
Now, to go and offer those suckers exactly that which they can not naturally get, requiring them to pay for it, is not that the worst form of adding insult to injury? And it gets even worse when we realize it is the women themselves who, through their unwillingness and pickiness, create the very scarcity that makes prostitution economically viable to begin with; a classical conflict of interest, not entirely dissimilar to the Mafia's collecting protection money after first breaking your fingers to demonstrate that you indeed require their protection. Clearly, prostitution is an abuse, with — make no mistake — the prostitute as the abuser and the customer as the abused. It amounts to selling something that is not for sale, that is naturally free. That some prostitutes have "pimps" or are coerced does not fundamentally change this, on the understanding that in such cases the conglomerate pimp/prostitute plays the role of the abuser. Sweden has got hold of the wrong end of the stick; if any party is to be punished, it is the prostitute.
I venture to say that prostitution is not truly "the oldest profession", but easily predated by activities like gathering food, tool-making, hunting, and going to war. In our nomadic hunter-gatherer days, it is doubtful that women had the power to act as prostitutes in the current sense. Rather, what we now call "rape" may have been pretty standard behaviour, with the strongest men, who made the most kills in tribal warfare and hunted the biggest game, being the most proficient in fertilizing women and fathering offspring, often with females abducted from neighbouring tribes, thus bringing in fresh blood and preventing inbreeding, and therefore contributing to the health and success of one's tribe.
With the advent of agriculture, settlements, and especially the first cities, the level of civilization rose, and it became socially unacceptable to randomly take women with force. In response to that, new forms of sexual behaviour may have developed, of which prostitution is perhaps the most common one, others being homosexuality, fetishism, bestiality, paedophilia, and more such aberrations. This development would be logical, given (1) a stronger position of women, and (2) a felt lack of available females in those men who did not meet women's preferences.
Even more speculative, one can imagine that women kept preferring the kind of man that was the most successful in hunter-gatherer yesteryear — the strong, violent type — so that the new forms of sexual behaviour occurred relatively more in men with other qualities, like those in intellectual or artistic fields, these men being eschewed by most females. This may have caused a genetic relation between intellectual or artistic creativity on the one hand, and sexual deviance on the other hand; a relation that, until today, is expressed in sayings like once a philosopher, twice a pervert, and in the alleged over-representation of homosexuals in creative fields. Such a relation would also explain why (possibly hereditary) sexual deviations still exist after many centuries, despite the plausible reproductive disadvantage of these individuals (this paradox is the most obvious in the case of homosexuality, as discussed in The paradox of inherited homosexuality). The intellectual or artistic qualities might compensate for this disadvantage, thus allowing gene variants underlying creative achievement as well as deviance to be passed on despite it.