They don't glorify it (I'm speaking generally as you can't state the intent for a whole segment of diverse artists), as Chuck D from Public enemy has stated many times "Hip Hop is the CNN of the black community" — it's documenting what's happening in the communities they live in — sometimes from the perspectives of the criminals, sometimes from the perspectives of the victims. It's an artistic license to tell stories that are happening, though not a literal retelling. Artists from all genres, mediums and walks of life have used this to tell a story they feel needs to be told. Ice Cube wrote F**K the Police as a high schooler out of frustration due to everyday events both in his life, and from what he saw in his neighbourhood. It offended a lot of people who didn't have similar experiences from where they are from, but it didn't mean that it was literally his life experiences he was reporting, nor that he was getting his "sawed off".I find this somewhat ironic from Apple, given that a large segment of 'black' music glorifies gun violence and crime of various nature.
This is no different from a song like "Goodnight Saigon" by Billy Joel (a personal favourite, but he never served), a movie like Godfather (neither Francis Ford Coppola or Mario Puzo were gangsters in any way), Sting didn't advocate prostitution or stalking in Roxanne or Every Step You Take, and lets not forget that Johnny Cash said "I shot a man in Reno, just to watch him die"... wait, no... he actually did that. In fact Country music lyrically embraces killing and gun violence pretty heavily. The difference there is that people bother to understand the context of the artist before passing judgement.
What I'm trying to say is that just because an artist writes a song doesn't mean that it is literal testimony of their actions, beliefs and day-to-day life. Eminem never killed his wife (though in his music he did like 12 times), the music was an outlet for frustration, but as stated in stan it's just an artistic way to get stuff off his chest and maybe show others that they are not alone in their frustration. That's the point of art. Most rappers are not gangsters and usually get into music to get away from criminal activity, like any other endeavour such as post-secondary education, sports, and other artistic pursuits. That doesn't mean though that the environment they grew up in doesn't permeate through their art, it's how they deal, you are just misinterpreting it as glorification.