You mean "conformity" not "discipline". Unless you consider what some 9-year-old wears to be "bad behavior"
Nine year olds are not adults, and do not have the full constitutional rights that adults do. Dress codes are entirely appropriate in public schools.