It used to be that way, and probably will be that way again. I know of a few of people who got an early testicular cancer diagnosis that way. So it seems that there is a medical use for it.
Military medical exam is not for medical diagnosis! They don't care, they're there to enforce. It's worth the same as a dude pissing into urinal next to you and saying "nice balls mate". For official medical diagnosis you have to go through the procedures within healthcare system in your country.
Might be a different situation in other countries but in my country (Poland) showing your wiener to military guys will certainly not have any positive or constructive medical outcome. It's just a primitive domination and compliance ritual where they "verify your gender".