I would say generally yes if it is controlled by the teacher properly. If the teacher thinks he/she can control it and it is appropriate for the particular class then it should be allowed. If the teacher doesn't think it could be controlled enough and it is inappropriate for the class then it shouldn't be allowed. Ambient music in classrooms during study hall times could even enhance productivity if appropriate genres are used (such as classical or relaxing ambient). I think it should ultimately be up to the teacher but I see no reason why it shouldn't be allowed in school.
From personal experience, I find that music and podcasts can help you focus and make working on your schoolwork much more bearable. I also find myself a lot less mentally fatigued when I'm able to listen to stuff while I work on schoolwork. Let the kids put on heaphones and work on their classes.