iirc it's the dealer that does that not the factory. Kind of like a marketing hype for people to buy them "Oh hey this has an M badge so it must be better, I'll take it".

Chase said it best too for those that are debating other M parts such as shift knob, steering wheel, etc. Those actually function. The M badge is put there by people who want to pretend they're something they're not. Don't try and say it looks better either because the best and cleanest is no badge even on an M3 (it makes the rear symmetrical).