I don't give a damn what the excuse is for shaming that poor little kid, but it should never, ever be tolerated.
If there is a problem with tardiness, you talk to the parent. You NEVER make a kid pay for the "sins" of the parents.
This happened in my neck of the woods in Grants Pass. The superintendent there said it was up to the principal's discretion how to handle absences and tardiness. And of course this kind of crap is the result of principal stupidity.
Par for the course when you have supervisors with unchecked power.