Pornstars are in most cases cleaner, hotter, richer (high end pornstars) and they work for companies, smaller firms or big ones like brazzers, or DP, so unlike prostitutes they are contracted and employed and they actually get paid by companies, not people.
I guess porn is legal because the lawmakers enjoy it themselves!
A prostitute is paid by the person they have sex with, a porn star is paid by whoever is making/funding the movie plus a porn star has to have regular hiv tests and std screenings.