Jakscrakers, you can't give a reason beyond "them's the rules" and they must be unquestioningly followed.
I've double-checked the Handbook for my DS's school and there is nothing about hairstyles. There is a school uniform, which is specified but not exacting - white shirt, grey trousers, black shoes etc. There is also a list of clothing which is not allowed and they give the reasons why. So no footwear which could damage the flooring, no football colours because that can be divisive and encourage factionalism, no dangling earrings or other jewellery which could get caught and is a health and safety risk, etc.
The Handbook also states "Under no circumstances will young people be deprived of any educational benefit as a result of not wearing clothing conforming to the school’s dress code policy."
The OP's son has been isolated from his classes because his hairstyle is deemed "extreme". That seems to me to be very clearly a child being deprived of educational benefit, and that is very wrong.
I agree with MsHooliesCardigan about uniform and hairstyle being two very different things. Clothes can be put on for the school day, and taken off at the end of it. Hairstyles can not. And what's more, I would say that to insist on particular hairstyles interferes with bodily autonomy, and that is bizarre and controlling.
What harm is caused, and to whom, by a boy having short hair?
Why should a child be deprived of their education because their hairstyle doesn't fit with some arbitrary standard set by the school?