Some STD show up on a pee test, so that is one reason they have you pee in a cup.
On my 5 year physical, back in 1996, I had to do a piss test, and they found a high white blood cell count in my piss, which is an indication of an STD infection. HOwever, Ihad never had an STD before.
THey did the ol' q-tip up the penis trick (and it frickin' hurt) and it came up negitive for any STD's
Then I had to have a radiograph( I think that is what it was called), and they injected me with a radioactive dye to check my kidneys. All good there.
SO they efered my to a urologist at Camp LeJune, and he did the same test, except that they injected the dye from my penis to my bladder!!!! That was some serious pain, let me tell you.
Turns out that I had a stricture around my urethra, and they had to cut it out. That sucked, but Iwas on convo for 2 weeks, and light duty for a month after that.