The problem with deciding what is, or isn't illegal, when driving is that there are very few 'specific' laws (such as the one which says that you can't use a handheld mobile phone while driving). Most prosecutions are brought under 'general' laws, where it's up to a court to decide whether or not the law has been infringed.
For example, there's no specific law that says you can't drive a vehicle on the right-hand-side of the road. If the police see you doing it, they have to decide which (if any) 'general' law has been transgressed. i.e. they have to decide whether it's 'dangerous driving', 'driving without due care and attention', 'driving without reasonable consideration for other road users' or whatever. You can't be charged with 'driving on the wrong side of the road', simply because there's no such specific offence. (The milkman who drives his milk float down the right-hand-side of an otherwise deserted, well-lit road at 5am almost certainly ISN'T breaking the law because it's not dangerous, lacking in care and attention or lacking in consideration for other road users).
So if the police see you driving while using earphones/headphones, they can't charge you with 'driving while using headphones'. (There's no such specific offence). They have to decide whether they can convince a court that your driving is 'dangerous' or 'lacking in due care and attention' (or something else).
Therefore, unlike driving while using a handheld mobile phone (which can AUTOMATICALLY lead to police action), driving while using headphones/earphones MIGHT result in police action but it's NOT automatic.
As an analogy, people have ended up in court because they've been seen unwrapping a sweet while driving, eating a Mars bar while driving, tuning their car radio while driving, lighting a cigarette while driving, etc, etc but not everyone whom the police see carrying out such actions ends up in court. It can only happen when the police (and then the CPS) are confident that they can show that it resulted in driving which was 'dangerous' or (far more likely) 'lacking in due care and attention'.