Twenty pupils at a school in Sheffield were banned from normal lessons on the first day of term because they were wearing the wrong kind of trousers.
Yewlands Technology College head teacher Angela Armytage said the pupils had broken the dress code forbidding trousers with jeans-style back pockets.
New rules were brought in this term to stop uniform "inconsistencies".
Parent Andrea Martin said it was unfair her son Ryan had been punished for her mistake of buying the wrong trousers.
She said: "I can see where the school is coming from, I don't think there's anything smarter than kids in uniform, but they were black trousers - you couldn't even notice that they had two pockets on the bum."
The pupils were kept out of classroom lessons on Monday and told they would have to work in "isolation".
Ms Armytage said discussions about the dress code had begun last September and it had been designed and chosen by the students.
She said strict rules applied to trousers to ensure the pupils' dress code was "professional".
"What happens during the course of the year is the children start wearing patch pockets, and we have one external pocket, and then further external pockets start appearing down the legs and all over the place.
"They then start bringing in different cut black trousers with patch pockets on and we get nearer and nearer and nearer and sometimes fall right over to the jean look."
Ms Armytage said the pupils were kept out of lessons to stop more students wearing the wrong uniform.
She added: "We couldn't just say to them 'off you go for day until you get your trousers' simply because what happens is other students see this, and the next day we have 10 more and the next day we have 10 more and it escalates."