I am unable to understand that without any fault no teacher can do it.
Did you talk to your parents?
If it is only once then you forgive if it is repeatedly then with guidance of your parents either change your section or change the school.
You are not the only student. Many more may be there to get such things.
But it is old times punishment. Now nobody does it.
Your mother must go to the teacher & ask the reason.