Saying there were bad laws once upon a time doesn't negate the fact that laws by their very nature have very strict black and white definitions.
This argument can literally be applied to anything. You could rape, murder, steal, rob, do anything on the flawed logic of America once allowed slavery therefore I should not have to follow any laws. That's not a road civilized society should go down. If you don't like a current law take it up with the branch of local, state of federal jurisdiction that writes the laws where you live and try to have have it changed, but if it's currently law, follow it.
I don't think prostitution should be illegal, but I'm not gonna cap for people that get arrested doing it. You knew the risks of breaking the law.
What we should do instead of saying we don't have to follow laws we don't agree with is try to legalize prostitution. They did it in Nevada.