I tried to figure it out. After observing him and others, it seemed to me that he believed he was immunizing himself against accusations of sexism. If I charged him with sexism, I'd be implicitly accusing him of lying. He thought I'd be reluctant to do that.
It's not just men who try to immunize themselves. Many people recognize that when someone tells a woman, in a professional setting and in front of her colleagues, how lovely she looks, while praising men for their work, this can undermine her professional stature in the workplace. But some women readily compliment other women on their clothes, in front of their colleagues. Sometimes they accompany it with "This would be sexist if a man said it, but it's fine since I'm a woman." If it's not OK when a man does it, why is it OK when a woman does it? In my book, saying it's OK doesn't immunize their actions from scrutiny.
And when someone begins a sentence with "I know this might sound racist (or sexist), but …", that self-awareness doesn't necessarily make it less racist or sexist.