The prestigious Oxford Bible Commentary on the Gospels (published by Oxford University Press) is clear that the author of Matthew’s gospel deliberately changed the words of Jesus in the earlier gospel of Mark because they were “embarrassing” to him.
Why were they embarrassing?
Here is the story in the earliest gospel to be written, the gospel of Mark:
As he was setting out on a journey, a man ran up and knelt before him, and asked him, “Good Teacher, what must I do to inherit eternal life?” Jesus said to him, “Why do you call me good? No one is good but God alone.”
The Oxford Bible Commentary on the Gospels comments (on page 113):
The evident embarrassment caused to later Christians (Matthew!) by the story in which Jesus appears implicitly to reject the notion that he himself is ‘good’ [in Mark 10:17] suggests that we have here a genuine tradition.
Matthew rewrites the story to have the man ask Jesus ‘what good thing must I do?’.
Here is the same story in the gospel of Matthew 19:16-17 (most New Testament historians believe Matthew used Mark to write his own account):
Then someone came to him and said, “Teacher, what good deed must I do to have eternal life?” And he said to him, “Why do you ask me about what is good? There is only one who is good.
Mark writes: Jesus said to him, “Why do you call me good? No one is good but God alone.”
Matthew changes Mark to read: Jesus said to him, “Why do you ask me about what is good? There is only one who is good.”
Matthew did not treat Mark as the precious Word of God as Christians do today. He felt free to change it and correct it as he pleased. Scholars have noticed other significant changes Matthew made to Mark because he disagreed with him.
In the earlier more historically accurate account in Mark Jesus is portrayed as a humble Jew who rightly attributes all goodness to his Creator. The real Jesus was an embarrassment to later Christians who began to exaggerate his significance. As the Qur’an warns Christians:
‘O people of the Scripture! Do not exaggerate in your religion, nor utter anything concerning God save the truth. The Messiah, Jesus son of Mary, was only a messenger of God, and His word which He conveyed unto Mary, and a spirit from Him. So believe in God and His messengers, and do not say ‘Three’. Desist, it will be better for you. God is only One God. . . . The Messiah would never have scorned to be a slave of God.’ (Surat al-Nisa, 171-2)
Dr Timothy Winter of the University of Cambridge notes:
‘The Qur’anic term for ‘exaggeration’ used here, ghuluww, became a standard term in Muslim heresiography for any tendency, Muslim or otherwise, which attributed divinity to a revered and charismatic figure. We are told that during the life of the Prophet’s son-in-law Ali, a few of his devoted followers from Iraq, where Hellenistic and pagan cultures formed the background of many converts, described him as God, or the vehicle of a Divine incarnation – hulul. The claim of course irritated Ali profoundly, and he banished those who made it from his sight; but even today marginal Islamic sectaries like the Kizilbash of Turkey, or the Alawites of the Syrian mountains, maintain an esoteric cosmology which asserts that God became incarnate in Ali, and then in the succession of Imams who descended from him.
Mainstream Islam, however, despite its rapid spread over non-Semitic populations, never succumbed to this temptation.’