For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

Rep. Matt Gaetz (R-Fla.) has securely established himself as one the biggest Republican trolls in Congress. He loves nothing more than taunting his Democratic colleagues and questioning their patriotism. He recently called Democrats working on impeachment proceedings against President Donald Trump “an angry pack of rabid hyenas” and led his GOP colleagues to storm the deposition of an impeachment witness in the Capitol’s sensitive information facility. So why, then, has he become an outspoken defender of Rep. Katie Hill, a Democrat from California?

Hill, who until recently was one of the party’s rising stars, recently announced her resignation following revelations that she had a three-way affair with a campaign staffer and her now-estranged husband. Congress had launched an ethics investigation into allegations that she also had an affair with one of her congressional aides. (Hill, who is openly bisexual, has admitted the affair with the campaign staffer, but denied the relationship with her House aide.) Hill’s private life became headline news after the British tabloid the Daily Mail and conservative website RedState published nude photos of her without her consent. She has suggested that the photos were leaked by “an abusive husband who seems determined to try to humiliate me.” Her husband has denied leaking the photos.

Not many of Hill’s Democratic colleagues have stepped forward with full-throated defenses of the 32-year-old member of Congress. But Gaetz did. Last week, as the allegations were unfolding, he tweeted: “Who among us would look perfect if every ex leaked every photo/text? Katie isn’t being investigated by Ethics or maligned because she hurt anyone—it is because she is different.” Later he tweeted: “Congress should write a budget before we play ‘bedroom police’ or allow an ex to illegally humiliate our colleague for being different. Key fact: Not a whiff of a complaint from anyone who has worked for Congresswoman Hill. Just an angry ex releasing revenge porn. Sad!”

“Katie isn’t being investigated by Ethics or maligned because she hurt anyone—it is because she is different.”

Gaetz’s tweets were notable for their empathy, something that rarely shows up in his regular Fox News appearances, where he serves as an attack-dog surrogate for the Trump administration, frequently lashing out at Rep. Adam Schiff (D-Calif.), the chair of the House Intelligence Committee, and calling him a “pencil neck.” Many in Gaetz’s party have made attacking LGBTQ people part of their platform, and other GOP members of Congress rushed to call on Hill to resign.

So what gives? I wrote a long profile of Gaetz earlier this year and spent months reporting on him and interviewing people in his district. I have a couple of ideas.

First, Gaetz, 37, is a millennial like Hill. He was an early adopter of Twitter and is deeply immersed in social media and Instagram selfie culture. He understands all too well that lots of young people may have a photo trail they would rather not see made public. As I wrote in the spring:

Two years ago, a former staffer sent [Gaetz] a blunt text message about a 21-year-old woman Gaetz was dating, who would later become a Democratic congressional intern, urging him to ask the woman to delete photos of him from her Instagram account. The staffer wrote, “Don’t be surprised if many of the conservatives and competitors, like Cris Dosev in Florida CD1, may frown upon her sexually explicit images, her videos showcasing her multiple capabilities to smoke weed, and her flagrant application of language as antithetical to the values of Northwest Florida.”

But I suspect Gaetz’s motivation for defending Hill may run deeper than his own dating life. He seems genuinely committed to the idea that his party needs to move into the 21st century and abandon its attacks on LGBTQ people. Back in 2015, when Gaetz was still a member of the Florida House, the state legislature was considering a bill that would roll back a decades-old law banning same-sex couples from adopting children. Republicans tried to add a rider to the bill that would have allowed private agencies to invoke religious freedom as an excuse to continue to discriminate against gay couples. Gaetz’s father, Don Gaetz, was then the state Senate president. He helped defeat the religious freedom provision and roll back what he referred to as the “archaic, dusty, dead law.”

A staunch religious conservative and acolyte of former Florida governor Jeb Bush, Don Gaetz had never been a champion of LGBTQ rights. But he credited his progressive stance on the adoption bill to an influential adviser: his son, Matt. “My son sat me down and said, ‘Dad, nobody under 35 cares about this issue. Only you old guys…Republicans shouldn’t care,’” Don Gaetz told a group of Florida State University students in 2015.

Earlier this year, the Florida legislature took up another bill that would outlaw workplace discrimination based on gender identity or sexual orientation. Social conservatives were outraged and attacked the bill’s sponsor, Sen. Joe Gruters, who is also chair of the Florida GOP. Matt Gaetz came to his defense, saying, “People don’t choose to be gay, and we shouldn’t be mean to people based on who they are.”

Last year, Gaetz told The Hill that the GOP needed to move away from attacking gay people if it wanted to attract younger voters. “I think we need to make it very clear that we don’t hate gay people,” he said. “That doesn’t mean that we want to deconstruct the concept of the American family, I think we need to support the family as the principal institution of American life. But for people who don’t fit neatly into that, you know, ‘Leave it to Beaver’ mentality, there needs to be broader acceptance in our party.”

Gaetz doesn’t always live up to his own standards. In April, he made a few headlines during a House Judiciary Committee hearing on the Equality Act, a bill that would ban discrimination against LGBTQ people. Gaetz insisted that he would have liked to support the bill because he’s opposed to discrimination against transgender people, but he couldn’t bring himself to vote aye because he believed the bill would allow “bad actors” to somehow “weaponize” it to their advantage. To illustrate his point, he said, “Consider this possibility: If President Trump were to say, ‘I am now the first female president,’ who would celebrate that? Would those who support the legislation think that’s a good thing or would they be dismayed?”

There’s another reason Gaetz may have some sympathy for Hill, with whom he has served on the Armed Services Committee. He has said repeatedly that he is straight, but he has been the target of anti-gay vitriol himself. Rumors about his sexuality have been promoted by some of his political opponents and a discredited conspiracy theory website. The lawmaker has been chill about this, once tweeting: “while I have nothing against gay folks, that ain’t me.” It’s hard to imagine that Gaetz has been entirely unaffected by the attacks. He could be the rare straight man who knows what it’s like to encounter anti-gay bigotry firsthand, an experience that might affect how he views Katie Hill.