I don't own, so don't sue.
The sorting hat didn't know how it got there, it just knew that it was there, in the past. The hat, being a hat, really had no way of using it's knowledge of the future, except by sorting certain people based on their future actions instead of what's currently in their heads. So that's what it did.
"Riddle, Tom." A small boy walked up, and the hat was placed on his head. The hat didn't bother going through his mind and sorted him right away.
"HOUSE ELF!" The hat shouted. And so Tom went to stay in the kitchens with the house elves.
Just something I thought up in the early morning. What do you think, should the hat from the future sort more people?