Matthew was not the first gospel written but it comes first in the New Testament for obvious reasons. Matthew was the only disciple of Jesus who was literate so he was an obvious choice to write about the life of Jesus. Matthew is the most Jewish of the gospels because it was written by a Jew writing to a Jewish audience to convince them Jesus was the promised Messiah. Matthew did this by linking the Old Testament prophecies with fulfillment of those prophecies in the life of Jesus. This made the gospel of Matthew the perfect bridge between the Old and New Testaments and linking them together as one Word of God.
The gospel of Mark was written by a Jew named John Mark who was a disciple of the Apostle Peter. Peter preached in Rome and believers there, both Jew and Gentile, wanted a written record of the gospel message being preached by Peter. Peter was illiterate so it fell to Mark to write down all that Peter was preaching about the life of Jesus. Mark went with Peter everywhere he preached so he knew all that Peter was preaching by heart. Mark is recognized as the first of the gospels to be written. You may wonder why the gospel isn’t named for Peter. Peter didn’t dictate the gospel to Mark. Mark wrote the gospel himself based on his memory of what Peter preached. I’m sure Mark read the gospel to Peter for his approval before finalizing it. Let’s not forget Mark was a powerful preacher in his own right and preached the gospel to all nations alongside the Apostles and was himself martyred for preaching the gospel message.
Luke was a Gentile physician and disciple of The Apostle Paul who based his gospel primarily on the preaching of Paul. There were other eyewitness testimonies, facts and other evidence Luke uncovered by his own investigation. Who better to write a gospel to a Gentile audience than another Gentile? By using Luke in this manner God was showing his salvation was inclusive, that God’s mercy and grace was for all people who believe in Jesus, not just the Jews. Luke and Matthew were written about the same time. Nobody knows which came first but it doesn’t really matter. Both were written after Mark. The gospel of Luke stressed Jesus’ humanity.