They are all boys, so there is nothing to be ashamed of. They won't be naked or shy, so many people will go shirtless, which is more convenient and comfortable and more honest in front of their classmates.
The less people wear, the more comfortable they are. If they feel uncomfortable, it's only psychological reasons. It's definitely the most comfortable choice not to wear clothes in very hot weather.
But in order to protect their reproductive organs, so boys will definitely wear a pair of underwear. Therefore, it is certain that most boys sleep in underwear in high school boys' dormitories in summer. If not, they may even be excluded or disliked because they can't integrate into this group.