I suspect there would be no such action taken if the kid were white/European and the teacher asked him/her the same question (about legal status).
If he was a white European kid, he likely would NOT have been asked this question by his teacher in front of the class. It is up to the administrators to know if their students are legal US residents and deal with them accordingly. If a teacher has confirmed knowledge that a student is an illegal, he/she/it should report the student. A teacher's job is to educate students if they are present in class and mark them absent when they fail to attend.
No, this wasn't a racist question, per se. But it was not tactful, a quality that a public educator should have.