My son does this and it drove me nuts until it was explained that he does it to block out other noises and help him concentrate. A classroom environment can be very distracting so it may just be how they concentrate in the chaos. If the teacher doesn't like it, some earplugs may help.