It doesn't get talked about nearly as much, but there was a time when religion was every bit as influential in the course of rap music history as gang culture eventually was. The religion in question, specifically, was Islam. There are any number of explanations for why this changed, ranging from full-on conspiracy theory nonsense (record labels conspired to promote gangsta rap as a means of killing "conscious rap" and filling prisons) to the completely reasonable (rap nowadays is more of a reflection of America in general as opposed to just the inner-city neighborhoods where it started in its earliest days).
The sect of choice for discerning mid-to-late-'80s rappers looking to inject a little spirituality into their rhymes was the Nation of Islam, an offshoot founded in the United States back in 1930. They have, at various points in history, been accused of being "black supremacist" and "antisemitic," to the point where they're actually tracked as a hate group by the Southern Poverty Law Center.
For a perfectly representative example of why that is, look no further than the story of Yakub.