What causes pain after masturbation in a patient with epididymitis?

Why do epididymitis patients have pain after masturbation?