Why would he avoid her advances in the other episodes? It's really unlike his character to do this.
I think it was definitely moffat's intent to return the doctor the classic series doctor in form and function. I think under RTD's reign he turned him into too much of a James Bond sort of hero and it failed the fans and the show, as a whole. I think the essence of Doctor Who is the ethics the doctor has built himself on.
As sort of a side note here, i think his call for the humans to exterminate the silence was a bit over the top for what the situation warranted. We just weren't shown that they were a threat to the humans, aside from the one killing the woman, which i thought was a token gesture on the part of moffat to show they were dangerous, really to warrant the doctors over zealous death cry.
I was disappointed that we weren't given one of the doctor's banal speeches about freedom and the like instead. Further more, I didn't care for River being a plot device in that regard to start firing randomly at aliens. I think her level of "action" is necessary in some cases, as I say below, but I think the entire scene was manipulative at best.
Someone posed the same question (more more or less) on LiveJournal, but they were also wanting to know why it was ok for the doctor to be involved with River, but not Rose as most of the fans have come to detest the relationship.
This was my response over there:
I think for me, and what I've noticed and been most shocked by is the change in attitude of fans over the 5 years or so. Most the of the reaction back then was pro drama and romance and now it seems more vested in the story telling as the show has more or less gone through a change in "format" if you will.
I think the distinction is that the romance between river and the doctor is second to the plot and what is shown hints at other mysteries and untold stories that serve to further increase our interest in the show/story.
I think also the way it's been presented is pretty straight forward. We know something happened in that they shared a large portion of their time lines together, but we just don't know the details, but whatever it was, it was real. River is mature in contrast to rose and the other companions and through that we get a sense that is was a real grown up relationship which is the foundation behind their lovers quarrels and playfulness.
I think in contrast, whatever existed previously, was written from a sensationalist point of view and without a foundation. We'd be in the midst of an adventure to yanked out of it in these "rubber band" moments where they would almost kiss or the Doctor proclaims "I do it for Rose". Why? What happened? We weren't privy to it even though we were with them both since they met. I think in those series, the story came second to the drama and romance, which at times could be blatantly manipulative and self indulgent.
So I think on the whole, people are more accepting of the doctor's relationship with river because it's tangible, it gives the characters depth that drives their interactions during the main conflict of the plot.
In another way, they compliment each other like a real couple, the doctor is giddy, childish, wise, over ethical and moral. River is raw, in the moment, practical and a solid foundation that anchors his mania.
They need each other, and the only way the doctor (our classic doctor, of which 11 is an extension) could sweep into a young girls life and form a relationship with her, is if he met her in the middle, in the midst of their relationship when it was healthy and mature and then progress backwards to when he first meets her.
The doctors life is full of solitude and despair. Our classic doctor wouldn't have gotten involved with someone so young because it'd be unethical in his eyes. And he also wouldn't have gotten involved with anyone either because he'd have to watch them grow old and die. The only way it could have happened is if it was dropped flat in his lap, right in the middle of it where he would have no choice but to recognize that it was entirely possible and beneficial as well.
So I think in a lot of ways, it works and satisfies the requirements of the fans and the show as well.