Actually, this behavior is more common nowadays when the electronic devices are smarter than before. However, it is not a good way to take a lesson that is not polite to the instructors. Unless students listening to music is relevant to the class, but most of the time students only listen to music because of the boring class.
Moreover, instructors are human, with equal-right as students, they should not be treated by this rude behavior.
It is not only rude, it also reduces marks on anything that you’re doing and reduces concentration. Multiple studies say that listening to music through headphones in class reduces marks if you are sitting tests or exams. A study done by Doctor Nick Perham, a lecturer from the school of health sciences at the University of Wales Institute in Cardiff, showed that music with variations in sound reduced performance. When people were listening to music through their headphones, whether they liked it or not, the results were the same, and both were worse than when it was quiet.
Studies show that white noise helped more inattentive students to pay attention and made it harder for attentive students to pay attention. The key difference is likely how sensitive a student is to being distracted by background noises. Since we don't want to ruin the attention of those students who aren't as effected by background noises we should allow students more effected by those noises to wear headphones and listen to white noise to help.
Of course most students listening to headphones will just listen to music, but that shouldn't spoil it for those students are using their headphones to help themselves focus. If we want to control this then teachers should check the headphones to make sure they only have approved sound files on them. Or we could just educate students about the effects of noise (music with variation v. White noise) on performance. They should be aware that white noise can help or hinder depending on how badly you are distracted by background noise and that they should use their best judgment about when they need it and when they don't.
Or we could require a diagnosis of ADHD, autism, misophonia, or sensory processing disorder for the student to be allowed to use headphones, but there are probably plenty of students who would do better with white noise but whose attention problems aren't bad enough for them to fit a diagnosis. Burdening students and parents with having to seek a diagnosis just to be able to listen to white noise in class is unnecessary.
Another thing to consider is that regular music may not be as much of a hindrance in an art class or a creative writing class and could actually help with the creative process.