I've thought about this since the HIMYM finale, and disagree with whoever said it "goes against what they've established in the last couple of seasons."
The thing is, it absolutely does not go against that. The entire series always has Ted going back to Robin. Yet, the last couple of season's actual *plot* has Robin giving up on Ted, and marrying Barney. She's *with Barney*. Ted had no choice but to move on, because of Robin's choice, a couple of years ago. The more I thought about it, it makes complete sense that a spurned man would move on, find love, be happy, have kids, and the wife could die, and, in his early 50's, still be youthful enough to seek out love again. So, he went back to Robin in the end, when they were both available what, 10-15 years in the future? Makes perfect sense when you think about it.
"There is no use trying," said Alice; "one can't believe impossible things." "I dare say you haven't had the practice," said the Queen. "When I was your age, I always did it for half an hour a day. Why, sometimes I've believed as many as six impossible things before breakfast." --Alice in Wonderland