I knew they did this but what is the reason for this? I can only think of prostate/anal cancer exam or looking for signs STDs? but I doubt they can visually check that.. I just googled it and no one has a legit answer.. some troll even came up with a conspiracy theory. But why do they need to know if you have STDs or not?
Not prostate cancer, they need to check the gland for that. They are checking for abnormalities like fissures, fistula, hemorrhoids, thrush, etc.
As far as the genitals, they are checking for abnormalities such as undescended testes, and possible hernias. They are also checking for lumps in the testicle. Men in their 20s are a high risk category for testicular cancer.
If you REALLY want to get in the weeds regarding the specifics of commissioning physical requirements, there is a VERY detailed instruction regarding examination requirements, disqualifiers, and other specifics.
It can be a dry read, but if you are ultimately commissioned as a Naval Officer, you will very quickly learn that there is a set of instructions for EVERYTHING. There's MILPERSMAN, BUPERSINST, NAVADMINS...etc. They outline incredibly specific guidance for everything. I HIGHLY recommend that you get into the habit of learning how to look for these instructions. It will show a a high level of competence and resourcefulness, above what is expected of a Junior Officer. Your supervisors will see that you have the ability to work autonomously.
Why is this important? Because besides your grades, board scores, and other academic related metrics, this performance would impress your supervisors - and will reflect in your FITREP. This is a positive when submitting packages for residency.
If I'm wrong in any of this, or there is anything to add, I'll ask
@vellnueve to chime in, as he has much more firsthand experience.