It's probably both racist and classist, but the fact is shootings get more attention when they seem to your average news consumer like something that might have happened to them or to someone they love. So, they pay attention to shootings of random strangers in settings that they or their loved ones might frequent (restaurants, workplaces, movie theaters, schools). They're less likely to pay attention to killings where the reasons were very personal (e.g., guys killing their own family members), or where they were in the kinds of settings the typical news consumer can't picture himself or his loved ones visiting (e.g., a predominantly black and poor, crime-ridden neighborhood in Baltimore.) The only major exception are crimes involving celebrities.
For-profit news relies on drawing an audience, and if you want to drive them with crime stories, you are going to want ones that scare them. And the richer the people it scares, the more valuable the audience it draws is to advertisers. That's why, for example, plane crashes get vastly disproportionate attention in the news, relative to their actual importance in mortality statistics. Rich people fly on planes a lot, so tales of spectacular and random death that could hit them will draw a valuable audience for advertisers. That's capitalism for you.