When Vice President Mike Pence was governor of Indiana, he got along well with the mayor of South Bend, Pete Buttigieg, despite the fact that Buttigieg is a gay, liberal Democrat and Pence is a straight, socially conservative Republican.

Things changed. Pence became the vice president, and Buttigieg decided in April to run for the Democratic presidential nomination. Suddenly there was bad blood where there used to be mad love. Buttigieg insinuated that Pence had a problem with Buttigieg’s sexual orientation and marriage to another man.

“If me being gay was a choice, it was a choice that was made far, far above my pay grade,” Buttigieg said at an event for the LGBTQ Victory Fund. “And that’s the thing I wish the Mike Pences of the world would understand — that if you’ve got a problem with who I am, your problem is not with me. Your quarrel, sir, is with my creator.”

The controversy had a bit of a high school feel to it in that Pence initially objected (correctly) that Buttigieg was being unfair to him given that they had once gotten along swimmingly. But Pence played the victim card, too.

“He said some things that are critical of my Christian faith and about me personally, and he knows better,” Pence complained.

In a sense it was a win-win for both politicians, given their very different constituencies. Each got to play the martyr for his own side.

And there was a third winner: the media. Buttigieg’s dunking on Pence was great fun for the mainstream press, which loves Buttigieg almost as much as it hates Pence. It was a neat and tidy morality tale pitting the forces of tolerance and equality against the forces of bigotry and oppression — Buttigieg the gay scholar veteran vs. Pence the would-be ruler of the Republic of Gilead (the fictional dystopia in “The Handmaid’s Tale”).

This is all old news, of course. But it seems newly relevant given that Buttigieg has a new problem with Christians who object to his lifestyle. But it’s a very different problem.

During Buttigieg’s recent appearance on NBC’s “Meet the Press,” host Chuck Todd read him a statement from the Rev. Rodric Reid, an African American pastor in Indianapolis.

“I guarantee,” Reid had told the Indianapolis Star, that Buttigieg’s marriage to another man “is going to be an obstacle . . . That is really still a touchy subject, specifically and especially in the African American church.”

Todd also noted that he’d talked to black congressmen who said Buttigieg’s homosexuality could be a problem with segments of the African American vote.

Buttigieg’s answers were respectful, thoughtful and hopeful that he could work it out with black Democratic voters.

But the question remains: Why don’t those voters get called bigots?

It’s a rhetorical question, of course. We know why. Attacking Pence and the people he supposedly represents is good for fundraising and votes in Democratic primaries. Calling religious black voters bigots for having the same misgivings that some religious white voters have is political suicide.

The point here isn’t really about homosexuality or gay marriage — both settled issues legally and almost certainly politically. Nor do I really care about the hypocrisy of it all, as much as it may annoy me.

The way the media tends to handle culture-war controversies is deeply pernicious. As I write this, we’re nearly a week into a debate about whether detention centers are “concentration camps.” Wherever you come down on this semantic row, the fact is that the media would never have entertained this “debate” under Barack Obama. We know this because he had detention centers as well.

Similarly, some Democrats are attacking Joe Biden for having had collegial relationships with segregationist senators. That’s fair game. But if this debate were going on in the GOP, the media coverage wouldn’t be the riot of nuance we see before us. It would be simple and straightforward: Racist racists act racistly.

The GOP certainly has its race problems, and I feel no obligation to run to its defense.

But if you want to know why millions of Republicans no longer care when the media shouts “Racist!” or “Bigot!” . . . just look at how they whisper “It’s complicated” when talking about Democrats.

Twitter: @JonahNRO