It's bad to act out on an attraction that's illegal.
Jim is driving home, and he comes across a hooker on the side of the road.
Jim wants to help the hooker.
Jim gives the hooker some money to help her out.
Jim pays the hooker to have sex with him.
The hooker gets to buy something for herself, and Jim doesn't break any laws.
Jim and the woman are violating the law.