Some manufacturers have chosen to implement this "safety feature" to prevent potential accidents. The idea behind this is that by only allowing the radio to be used when the car is in park or neutral, it will reduce the risk of driver distraction. While listening to music or talking on the phone while driving is not illegal, it can still be dangerous, as it can divert attention away from the road and increase the risk of an accident.
Additionally, some vehicles have a "speed-sensitive volume" feature, which automatically lowers the volume of the radio as the vehicle's speed increases. This is also intended to reduce distraction, as it ensures that the driver is less likely to be overwhelmed by loud music while driving.