So what did this teacher do wrong? He wants to make sure his students are here legally. That is a problem?
It probably comes down to tact.
I think it would have been better for the teacher to take his or her concerns to the administration for proper action rather than accost the 8th grader while at school. The teacher should have expected this type of reaction. What did they expect? The student to just bust out with the papers on the spot? It's the administration's responsibility to contact the parents/English speaking relatives to shore this information.
Of course, if they'd done so from the get go, none of this would have happened.