A jukebox feature isn't that difficult to build, it's just something that doesn't serve the intended experience for certain types of games. Games with a stronger focus on narrative will usually keep a tighter control of music in order to set the stage for the characters and their emotions, especially in narratively-important scenes. GTA straddles this line in their games - the jukebox is limited to gameplay only and does not break immersion during the story scenes.
Games with a focus on driving tend to allow players to choose an audio playlist, but they are hardly the only ones. Several fighting games also sport a jukebox feature like Tekken and Guilty Gear, but it also exists in games like Payday 2 and Sonic Frontiers. Jukebox support tends to be a fairly low priority feature since it's not a huge selling point, but there are some who care enough about adding it to a game that it shows up now and again.
[Join us on Discord] and/or [Support us on Patreon]
Got a burning question you want answered?
- Short questions: Ask a Game Dev on Twitter
- Long questions: Ask a Game Dev on Tumblr
- Frequent Questions: The FAQ