Answer: Prevent economic desperation.
In this dystopian future if prostitution is illegal and the law is heavily enforced then desperate people will find other ways to make ends meet which will surely be more harmful to society.
And the answer I most often see is to have a universal basic income, which makes sense to me.
The main argument against basic income in the United States is that it discourages people from working. I think that's probably true, and in this country we see work as a virtue and an obligation. But I don't think the only thing we should seek from automation is to increase profits for business owners; we should also see it as improving human life in general by making work less necessary. And if work isn't necessary, shouldn't we provide a replacement for income that workers lose out on by the decreased availability of employment?
I guess that's not the only solution to the problem. I could also see the government taxing automated labor to artificially inflate its cost and thus encourage businesses to employ humans. I don't think it's as good of a solution, but it would solve the problem too.
"How do we prevent people from being forced into electrical engineering to get out of their economic desperation?"