I am not sure that there is still great differences between boy's students and girl's students school physicals for sport or annual routine examination but it was certainly true in the past.
in my opinion, there are obvious and logical reasons for the difference as regards genitals examination and other reasons less logical which were due to double standard.
The main reason is the different anatomy of boys and girs: the genitals of boys are external, so it is very easy to check by a visual examination and to touch and palpate them while it is not the case for girls.
So if a doctor is performing a hernia test which is useful for boys, it is logical that he decides to check also the genitals of boys and palpate their testicles. And the boy is normally undressed in underwear for that examination
But it is less logical that the examinations were performed in an assembly line inspired by military methods without partitions.
It is on that point that thre was a double standard : I doubt that girls were examined in that way and thre was certainly partitions for them so that they were examined with a certain level of privacy behind a curtain.
For boys the medical or school authorities did not think that it was necessary, they preferred to go faster and did not care about the possible embarrassment of boys.
As it was said in a message, for most of the adults to leave the boys keep their underwears or a jockstrap was enough for the respect of their modesty.
Boys were not supposed to be shy towards nudity on the reverse of girls and at leat in the past boys could not complain to their parents if they were instructed to remove or to pull down their underwears in an assembly line without partitions because their parents would have laughed ( the father) or told them to get over their embarrassment which not a masculine feeling while the parents were more concerned by the respect of the privacy of their daughters.
"Hildabert" : I find funny your message where it is said that at college in England in the 50's, screens were set up in a gym for girls being checked to get undressed behind but those screens fitted together badly so that the boys waiting at the entrance of the gym could see the girls in their bras and panties waiting and even taking off their bras before going through when they were called giving them a good view on their boobs but unfortunately a teacher or a nurse pointed out that issue and pushed the screens together.
In that message it is not said how the boys were undressed and if they were themselves exposed to the view of the girls if they were not undressing behind screens ....