 Matthew is always saying he did this to fulfill prophecy. You know, we're often very disappointed in the Gospels when we think of them as biographies. They are biographical, and their details are historical. But they weren't, I don't think, designed by their human authors to tell the story.