I would insert a caveat into this argument on the formation of gender as opposed to sex.
It is difficult to say to what level sex informs gender as we have very little idea about which demonstrated differences between the sexes are caused by what and less about how this would inform differences between the behaviours of members of different sexes. What cannot be doubted is that society builds the idea of gender and much gender based behavior stems from the resulting socialization.
Also humans are notoriously various. Even where differences in capabilities and behavior are provable to some point of generality this is no guarantee that comparative differences between individuals will not be either aberrant or greater.
All of which is to say, that is dangerous to say that society creates the entirety of any behavior without regard to other external, internal, individual, or historical factors.
But also to say, that we have a lot of play in talking about differences between societies and individuals within them whether those societies are real or hypothetical.
I would also add that a primary difference I see between early societies that do or do not participate in the behavior of ritual prostitution is the degree to which the society has been made fluent in property and households. One of the distinct differences in the account of Herodotus is the distinction between Greek society in which the individual and household is priveleged above all else, so that the polis is a collection of these units, and the Barbaric societies in which people are far more beholden to the idea of the group and the super-individual, such as the king or god.
This would be related to what I said above about the profit being expressed in non-monetary values.
In response to some prior questions, the Hebrew correlations are could point you to are mostly the ones that have been pointed out to me from the old testament. No full descriptions to parallel, which would be a little suspicious if they were there, but small details showing up in various places.
I'm not very familiar with the scope of scholarship on this subject outside of Herodotus, Gilgamesh, and the general works I've read on Babylon and Summeria.
Someone mentioned earlier that the Ishtar cults simply encouraged promiscuity and I have no idea if this is true or not. But I would suspect that part of the problem of sacred prostitution in areas with a mixture or religious practices would be that it makes an ideal convenience. The sacred adjective would provide woman who were prostitutes with additional protection, which would also make prostitution a far more attractive option. Particularly if there is a local culture that disapproved.
I think there was also a mention of the rise of proscriptions against sodomy from these interactions in the Eastern mediterranean. I don't doubt that there is truth to that, but I would also point out that the idea of sodomy and homosexuality is wildly flexible over the course of English history of the last 400 years alone. Claiming that current ideas of those proscriptions are that old makes the history of those ideas much simpler than they are.