There are a few reasons why.
First of all, you have to understand that sex and gender are two different things. Sex is a function of physiology, while gender is where you fit in with society's expectations. Curried Goats posted a link to Yale University's explanation of the two, which is as academic and unbiased a source as you're ever going to find. Here's the link again:
As we pursue our work at Women's Health Research at Yale, it is particularly important to use language that captures the different concepts of sex and gender so
medicine.yale.edu
So, to start with, the boy's t-shirt flies in the face of science.
A second reason is legal. Sexual preference and gender identity are protected classes under Title VII of the 1964 Civil Rights Act. (This was clarified three years ago in a USSC case called
Bostock v. Clayton County, Georgia.)
Displaying posters and so on to support non-discrimination of a protected class is acceptable, and one could even argue that it is what public schools
should be doing. Wearing a t-shirt that opposes a protected class is not the opposite side of a justice's scales, it is the wrong side of civil rights. Regardless of the administration's (or the kid's, or the parents') personal feelings about the issue, schools generally try to follow federal law.