Infection would be the most likely reason. I would consider various tests to evaluate this possibility.
This will include a urethral swab and urine tests looking for STDs (like gonorrhea and chlamydia) as well as a UTI.
The prostate should be examined via a digital rectal exam. If that is non-revealing, one can consider a transrectal ultrasound to better image the prostate.
Another possibility would be epididymitis - which can lead to inflammed testicles. An ultrasound of the scrotum can evaluate this.
These options can be discussed with your personal physician.
Followup with your personal physician is essential.
This answer is not intended as and does not substitute for medical advice - the information presented is for patient education only. Please see your personal physician for further evaluation of your individual case.
Kevin, M.D.
kevinmd_b