The closest thing which I could find in the FIDE Laws of Chess is
12.3 a. During play the players are forbidden to make use of any notes, sources of information or advice, or analyse on another chessboard
12.3 b. Without the permission of the arbiter a player is forbidden to have a mobile phone or other electronic means of communication in the playing venue, unless they are completely switched off. If any such device produces a sound, the player shall lose the game. The opponent shall win. However, if the opponent cannot win the game by any series of legal moves, his score shall be a draw.
However, I'm not sure if music from earphones would be considered as "source of information" or an "electronic means of communication". The competition rules may specify that any kind of electronic equipment is disallowed, and the arbiters have the right to arbitrate things like these as long as their decisions are not unfair or contradictory to the laws of chess.
But the arbiter cannot know whether it is music or someone reciting a chess book, so I understand if some people strongly object to arbiters allowing players to have earphones. At least I've never been to a tournament where using earphones was allowed.
Note that if other players can hear the sound from the headphones, it violates this rule:
12.6 It is forbidden to distract or annoy the opponent in any manner whatsoever. This includes unreasonable claims, unreasonable offers of a draw or the introduction of a source of noise into the playing area.