Learning something tends to be a gradual uphill climb: through practice and repetition you slowly become better. There are very few inherent concrete goals or thresholds, and it's generally fairly difficult to notice yourself improving because it takes place over a longer time period.
I struggle with perfectionism, which means while I enjoy learning I'm never hugely satisfied with the outcome. You can always bake a better cake, write better code, or whatever. But when you get that 'ding' of an achievement there's nothing even the most annoying bit of my head can argue about: I did the thing; there's no way to improve on it further. Annoyingly, that's far more satisfying for me.
Unfortunately (or fortunately), extrinsic motivation doesn’t work long term, doesn’t work if the extrinsic motivation stops, and most importantly, kills intrinsic motivation.
See Alfie Kohn’s book Punished by Rewards, containing dozens of pages of research proving the above.
https://en.m.wikipedia.org/wiki/Punished_by_Rewards
Extrinsic motivation is short term, naive, and harmful - but people trying to control the uncontrollable still like it and use it because it gives them the illusion of control.
It does not serve the learners.
I like the point you bring up. That badges and such make gaming seem less of a wasted time. I know people who can't tolerate open ended games for this reason: no clear goals. Minecraft added The End dimension specifically because of people like this, so that they can "finish" the game.
It has links to status as well I think. Even the name achievements and badges reflect this, and also they're often featured on the profile of the player, so that people can quickly compare others and themselves.
It seems to me the roots of this is the desire to please others before oneself. To use the "gamified" activity as a substitute for interaction with other people by making it seem to have some connection to anyone but just oneself.