If I defame my company, that company could take me to court or they could decide to just fire me. If a company decides to fire me for defamation rather than taking me to court, I have the freedom to challenge that accusation, suing the company for wrongful termination. If they do not have a strong enough case to prove I defamed them I am entitled to compensation.
This kid has the same right. If he believes he was mistreated because he did not infringe the rights of the teacher, he should sue the school system. And he should be well compensated if he was mistreated.