A centurion appears once in GMark:
“Now when the centurion, who stood facing him, saw that in this way he breathed his last, he said, “Truly this man was God’s Son!” (Mk 15:39 NRSV)
In GMatthew, there is a new scene that stars the centurion (Mt 8:5-13):
5 When [Jesus] entered Capernaum, a centurion came to him, appealing to him 6 and saying, “Lord, my servant is lying at home paralyzed, in terrible distress.” 7 And he said to him, “I will come and cure him.” 8 The centurion answered, “Lord, I am not worthy to have you come under my roof; but only speak the word, and my servant will be healed. 9 For I also am a man under authority, with soldiers under me; and I say to one, ‘Go,’ and he goes, and to another, ‘Come,’ and he comes, and to my slave, ‘Do this,’ and the slave does it.” 10 When Jesus heard him, he was amazed and said to those who followed him, “Truly I tell you, in no one in Israel have I found such faith. 11 I tell you, many will come from east and west and will eat with Abraham and Isaac and Jacob in the kingdom of heaven, 12 while the heirs of the kingdom will be thrown into the outer darkness, where there will be weeping and gnashing of teeth.” 13 And to the centurion Jesus said, “Go; let it be done for you according to your faith.” And the servant was healed in that hour. (NRSV)
The superficial purpose of this scene is to show that the centurion (admirably) has great faith. But Jesus has already praised several people for having faith, and their faith arguably enabled them to be healed. The centurion scene seems repetitive. Why did Matthew add this scene?
Let us assume that Matthew is not making fun of the centurion for having excessive or unrealistic faith.
I suggest that Matthew wanted to justify the centurion’s statement in the Passion, Mk 15:39 “Truly this man was God’s Son!” Matthew expected the readers/hearers of GMatthew to take it at face value. Naturally, they would wonder why a Roman soldier would recognize Jesus’s true identity before his disciples and other Judeans/Galileans. (Peter recognizes Jesus as the Christ, not as the Son of God.)
Matthew also changed Mk 15:39. Now, the centurion is not alone.
“Now when the centurion and those with him, who were keeping watch over Jesus, saw the earthquake and what took place, they were terrified and said, ‘Truly this man was God’s Son!'” (Mt 27:54)
The centurion is not alone; his extraordinary insight in GMark is no longer extraordinary. “Those with him” in Jerusalem might even be Judeans or Galileans.
Matthew must have known GMark had been a performed play. (At the time Matthew wrote [c.150], the Roman congregation must have had members whose parents had seen the play.) In the performed play, the centurion’s statement had created a complex dramatic experience for the audience. That audience had already seen the centurion as one of the Satanic-spirit-possessed pigs (Roman soldiers). In GMark, the centurion’s statement, like the other statements by Satanic spirits (e.g., Mk 3:11) though true, was Satanic!
But Mark’s text required the reader to imagine the performance to appreciate the centurion’s statement. Matthew knew that his readers would not do so. He added the minimum necessary material to GMark to keep Mark’s text usable. It is a fine piece of editing.