What historical forces make prostitution legal and accepted in some areas and times, and illegal and immoral in others? Has there ever been a time and place with no stigma about it?

by [deleted]

I’m trying to wrap my head around it, and I’m hoping historical context helps. I’ve heard people talk about times where prostitutes were priestesses, etc. but I’m not sure how much stock to put in those claims. Is there some common thread that consistently effects how different times and places see and treat prostitution?

Temponautics

This is a complicated subject, and I have personally not yet seen an overarching work on this (albeit it's not my field of expertise), so for your larger question, you also might want to try r/Anthropology.

Having said that, you might want to look at Jill Suzanne Smith's Berlin Coquette: Prostitution and the New German Woman, 1890–1933 (Signale: Modern German Letters, Cultures, and Thought)

There is an interesting part in the beginning where she discusses prostitution laws in Imperial Germany; as venereal diseases spread through (illegal) prostitution in the late 19th century, health authorities needed a rational solution to the problem, and thus needed to make it mandatory for prostitutes to have their health checked; to do so, the authorities needed to decriminalize it to be able to screen them, and in turn prostitution became legal and -- interesting to state coffers -- also taxable. The effect, socially, was, that prostitutes quickly saw themselves as a legitimate profession (it was, after all, suddenly legal to an extent, though socially of course still frowned upon), and within a fairly short amount of time brothels argued that they were, in fact, state employees given that they paid taxes, were government "quality checked" and state supervised (to an extent), asking to be considered to be civil servants. Nothing came of that argument, of course, but the groundwork for later full legalization in the Weimar Republic was laid. The Nazi regime banned prostitution again formally, which led to a drastic rise of an illegal prostitution scene, and the ban was (due to its many negative health consequences) lifted again after WWII.

In short: this is just a glimpse of that debate in one country and period. I think a larger generalization throughout history and all societies (Western and elsewhere) is rather difficult.
What one can point out though is that most societies have an ongoing, dynamic debate about the issues surrounding prostitution, and especially Western societies have not found a "stable" (that is lasting) way to deal with it and be satisfied. There are various attempts to deal with it from legal, moral, religious and hygiene standpoints, with pendulums of policies swinging back and forth between legalizing, banning, criminalizing or liberalizing sex work, but there does not seem to be a period in history, at least for societies that claim a basic immorality of all sex work, in which the situation was satisfactorily settled in any way; at best, there were and are phases of longer stability where societies accepted its existence and incorporated it into legal procedures (e.g. medieval Lucerne, Switzerland, a fairly deeply Catholic city, famously had legalized prostitution but did formally penalize priests for perusing their services through legal regulations, actually incarcerating them and not the prostitutes).
Most Western societies today seem to be stuck again in a policy of half-criminalizing it, with the occasional attempts to go after the "Johns" rather than the prostitutes themselves (e.g. Sweden's recent attempts), a policy which seems to also lead to sex work going "underground" again, leading to yet another undesirable outcome where prostitutes become unseen victims of unseen crimes and are again victimized even though the law attempts to help them.

One can therefore infer that the "historical forces" you are looking for are in the realm of cultural, religious, moral, legal, economic and public health contexts; and all of them, depending on how important they each are considered to be at the time, play a determining role on public policies regarding sex work. But that is as far as generalization can carry you at this point across all of history.