the confederate flag isn't necessarily a racist symbol. it represents the south's entire secession from the united states, which includes more reasoning than simple slavery. however, the connotations surrounding the flag in modern society are rather negative, and because of that, makes it rather distasteful to wear in public.
i don't think that the principal should be able to punish the kid for wearing it, but it all comes down to the school's dress code. either way, it's stupid to wear in school. you being on this site suggests that you aren't even from the southern region. even if this kid is southern, there are many more options of iconography he can wear to display his pride (perhaps a state flag). the confederate flag has just become a symbol for people to display how trashy they are anyway. classy people wouldn't think to wear it.
sparknotes:
should he be punished? probably not
is it dumb to wear a confederate flag in any circumstance? yes