They shot the ending while Ted's "kid's" were still teenagers so they wouldn't suddenly age 10 years, So if they wanted an ending that worked with the running theme of the entire series—Ted telling the story to his kids—then yah, they had to use it.