Matthew was written anonymously in about 70 to 100 CE, evidently by a Jewish Christian.Obviously borrowing heavily from Mark, the author of Matthew often explicitly indicates a prophecy fulfillment where the Old Testament passage was merely alluded to in the parent work.In favour of the author of the Gospel being a Christian Jew is the great interest that Matthew takes in showing that Jesus somehow “fulfils” the Old Testament.This is especially clear in his “formula quotations,” which repeatedly make this point (Matthew -23; 2:5-6; ; -18; ; -16; ; –21; ; 21:4–5; 27:9–10.2; note that scholars disagree as to what counts as a “formula quotation,” and how many there are).It is the near-universal position of scholarship that the Gospel of Matthew is dependent upon the Gospel of Mark.This position is accepted whether one subscribes to the dominant Two-Source Hypothesis or instead prefers the Farrer-Goulder hypothesis.
Although the first Gospel is anonymous, the early church fathers were unanimous in holding that Matthew, one of the 12 apostles, was its author.
The best answer seems to be that he agreed with it and wanted to show that the apostolic testimony to Christ was not divided.
Matthew, whose name means "gift of the Lord," was a tax collector who left his work to follow Jesus (9:9-13).
Mark, after all, did not even belong to the circle of the apostles.
Indeed Matthew's Gospel surpasses those of the other synoptic writers neither in vividness of presentation nor in detail, as we would expect in an eyewitness report, yet neither Mark nor Luke had been among those who had followed Jesus from the beginning of His public ministry.