The thing about The Doctor flirting with River is it’s both his denial for falling in love with her and the fact that he is falling in love with her. It’s obvious that he cares about her — The Big Bang proves that when he’s outright yelling at her to get out of the TARDIS. He doesn’t want anything to happen to her. He’s seen her die and I don’t think he ever lets himself forget it.To him, she has to live long enough to die then — fixed point of time, the usual mumbo jumbo — and that’s why it’s so hard for him to fall in love with her, but River being River is also why he falls in love with her.
She flirts with him effortlessly and it becomes effortless for him and so he does without thinking about it. One only knows how long the flirting would have gone on if they hadn’t been interrupted.
He flirts with her. He knows instinctively that she’s his wife of the future and that’s why, for a moment, everyone else fades away.