Why would my lower tummy hurt when I pee?

Urinary Infection. And a bladder or ureteral stone can cause these symptoms. In females vaginitis can cause similar symptoms.
Urinary pain. Could be many things including cystitis, bladder instability, tumor. A good urologist can help you figure it out.