I don't think it's ever OK for an adult, especially a teacher, to shame a child, especially in front of their peers. I would address this with the principal.