Morally speaking, it all boils down to protecting the form of expression. Probably, when the laws were written, there was the idea the sex for money is abhorrent, but freedom of speech needed to be respected. In fact, the core difference of prostitution and porn is that in the former, clients definitely don't want to be filmed, so it kinda makes (I'm not implying that I agree or not).
From a legal perspective, the distinction is considerably more detailed than just camera or not. This is a brief article: https://vistacriminallaw.com/pornography-vs-prostitution-in-...
I knew a longer article, but I can't find it.
Morally speaking, it all boils down to protecting the form of expression. Probably, when the laws were written, there was the idea the sex for money is abhorrent, but freedom of speech needed to be respected. In fact, the core difference of prostitution and porn is that in the former, clients definitely don't want to be filmed, so it kinda makes (I'm not implying that I agree or not).