The rules of the school no doubt forbid physical violence and expect children to use a process set up by the system to defend themselves against bullying / being wronged. That system failed and because you rightfully saw your son's right to self defense more important than following the rules, you encouraged him to defend himself outsides the confines of the system and its rules.
Later both you and your son were bullied / wronged by the principal. The rules of the state you live in ("laws") no doubt forbid physical violence / being wronged. That system failed...