You are assuming (like Trump) that human interaction is purely transactional, whereas religions emphasis the "fidelity" or qualitative character of a relationship. That's why the Christian ones usually refer to a marriage as being like the relationship of "Christ and his Church" (Book of Common Prayer) - one of continuity and "faithfulness". The argument of political conservatives (eg. David Cameron) in favour of same sex marriage is that it will promote social stability. Promiscuity undermines stability. The wording of the Marriage Act in many jurisdictions has been changed to define marriage as "a relationship between two people to the exclusion of all others". Note that that has nothing to do with breeding nor, frankly, with exploitation
Therefore promiscuity is frowned on - nothing to do with the production of bastards. Prostitution is seen as an extreme form of promiscuity. In the past 60 years (since The Pill) the whole basis of monogamy is being challenged. Children are no longer inevitable. Religions and social conservatives generally have emphasised the qualitative nature of a stable relationship. To do so they've been forced to acknowledge that it's not only heterosexuals who can have stable relationships, so the goal has become the stable relationship as the key to the stable society
Prostitution has sometimes formed part of religious observance, but it's generally seen as "sacred" prostitution to do with fertility rituals for a good harvest. We're only on the threshold of the sexual revolution that the Pill (and widespread availability of abortion - the two go hand-in-hand) has ushered in. Let's not behave as if relationships are merely transactional, or we'll end up in a Trumpian universe