Let me offer a potential explanation of this feature of popular music without making reference back to race:
Country singers do this sort of thing all the time, of course. Throughout his career, Johnny Cash would pray to Jesus in one track and murder his woman in the next, and hardly anyone batted an eye. But in the world of black music, shuttling between sacred and secular as Williams has done is a lot less common. For African-American audiences living in a segregated America, the gospel/pop line was about more than just faith. It was about loyalty to your people — about whether you were going to stay true to your oppressed community, or kowtow to the those who were, often quite literally, trying to kill you.
Hardly anyone batted an eye not because the sacred/secular distinction meant something else in country music culture, but because they recognized that his darker songs are not, generally speaking, about him--he's inventing or singing from the perspective of a character. Sam Cooke gets himself into trouble because it's Sam Cooke singing non-religious songs, not Same Cooke singing from the perspective of someone who is not especially religious. There's a certain songwriting approach that keeps up this distinction--Patti Smith would be another example, as would Bruce Springsteen--but almost all hip-hop and r&b music erases it (the only exception that comes to mind is O.D.B., who is sometimes O.D.B. and sometimes just a guy who's playing a guy named O.D.B.; many MCs will distinguish between their stage names and their actual names, but it's never clear what level this distinction is supposed to work on; people like Biggie Smalls and Tupac trade on verisimilitude; and, of course, if you're singing a song someone else wrote, maintaining the character/real me distinction is even more difficult).