Prince Andrew – His Royal Highness the Duke of York – is a man of many titles, but seemingly few talents. He does, however, have one superpower: scandal doesn’t stick to him. Having spent several weeks keeping a low profile following the whole being chummy-with-a-sex-offender thing, it looks as though Andrew has crawled out of the woodwork and is being rapidly rehabilitated.

On Sunday, the Queen appeared in public with her 59-year-old son for the first time since his car-crash Newsnight interview in November. Photographs of the two going to church show Her Majesty looking pleased and the prince looking pleased with himself. The man claims he has had trouble sweating, but by God can he smirk.

He certainly has a lot to smirk about: the coverage of his outing with Mum was a PR coup. “Disgraced Prince Andrew has become the Queen’s ‘rock’ during Megxit, royal insiders have revealed,” bellowed the Sun. According to these “insiders”, Andrew has been a “tower of strength” recently, “supporting his parents in their hour of need”.

Talk about a tale of two princes. While Andrew is described as a rock (he has the charisma of one), Harry is torn apart by the redtops, painted as an entitled brat who has abandoned queen and country to jet off and start a new life. Andrew has kept his titles and stipend from the Queen since the Epstein scandal, when he was made to step back from his public duties for the “foreseeable future”. On the other hand, Harry and Meghan have been forced to make a clean break from the firm and relinquish their Royal Highness titles and taxpayer funding. The Sussexes will also pay back £2.4m in public money spent renovating their home; Andrew has made no statements about his debts to the taxpayer.

The parallels between the princes are fascinating and infuriating. They were born into the same job: “spare” heir. Andrew is eighth in line to the throne, while Harry is sixth, so neither has much hope of becoming king; constitutionally speaking, it doesn’t much matter if they step away from their roles. They have been forced – in very different circumstances – to resign from their “jobs”. Yet their resignations have been treated wildly differently by the media. Harry and Meghan’s decision to relocate has been treated as a far bigger story than the fact that the Queen’s son was friends with Jeffrey Epstein, a child sex offender, and has been accused of having sex with a teenage girl who claims she was trafficked by Epstein, an allegation Andrew denies.

Why the discrepancy? Most obviously, there is racism towards Meghan. Then, as Alan Rusbridger pointed out in the Observer, there is the fact that the “major newspaper groups most obsessed with Harry and Meghan are … being sued by the couple for assorted breaches of privacy and copyright”.

Another reason is old-fashioned misogyny. The accusations levelled against Andrew aren’t reputation-ruining, because society doesn’t care what powerful men do to vulnerable women. Look at the president of the US, for God’s sake.

In many ways, the narratives around Andrew and Harry represent age-old archetypes. Andrew is the prodigal son; Harry is a hen-pecked husband. After decades of dissolute living, Andrew is proclaiming how sorry he is; inevitably, he will be forgiven. But the one thing society won’t forgive, as Harry is finding out, is a man putting a woman’s needs first.

•Arwa Mahdawi is a Guardian columnist