Depends on the CONTENT!
Use of sound and tone in the classroom is extremely important. Just like in a live performance, as a teacher you very much have to consider your audience.
Silence is powerful.
Remember those times your teacher said to a noisy classroom, "Oh I'll wait until you've finished your conversations," and gave a long, silent look? How quickly did your classmates end their conversations?
Much like flipping off the light switch, your silence can say a lot. And just the same, the presence of music or lack of it can prove quite useful. I find with young music students, they are eager to sing and make music. So if I immediately give them what they are excited for, they can often get unruly. But if I wait until they are ready to compose themselves, they perform wonderfully because they have been given the correct silence beforehand.
In other subjects, you would have to not only consider the audience, but the subject matter and relevance your audience may tie to the music. I happen to know a Physical Ed class would do better with upbeat pop music, and a math class would do better with Bach. But why? It is the audience and relevance of the material to the music!
What to play?
Again, I think this heavily depends on WHO is in your class, and WHAT you are teaching. Let's go with math for now. And let's assume inner city, 4th/5th grade because that is where I am currently used to working.
I would assume something the kids can sing to would be absolutely the wrong energy for that setting. If they know and are excited by the music, they will likely not pay attention to the lesson. Something without lyrics, preferably down tempo and low volume would on the other hand be great. People often recommend Bach or Mozart. I'd say both are excellent choices because their melodic and harmonic structures are not too (as Adam Neely says:) "Spicy". I'd also like to add in small combo jazz and instrumental big band because of their rich, but non-intrusive content.
After the lesson is over, to transition to the next subject, I may THEN AND ONLY THEN play some more familiar music as a reward for their hard work on the previous subject. Then back to the task at hand. Consider the crowd and act accordingly.
What do you think?