My school didn't allow us to use the showers after PE. First period PE meant you could either minimize your participation or be sweaty all day. The showers were only available for the sports teams after school.
My middle and high schools both required showering after PE class. You had about 10 minutes to shower and dress after class. It was part of the grade actually, if you skipped the shower you got docked a letter.
As I recall it was because all the other teachers didn't want a bunch of sweaty smelly kids in their classes.
Middle school and high school kids can be viciously cruel and disgusting. Things that if done by adults would land them in jail and on a registry. Your school probably made the right call.
Don't know how common that is.