Without going into wearisome historical details, we need to remember that these letters were written, and the lives they indicate were led, against the background of paganism. There were no churches, no Sundays, no books about the Faith. Slavery, sexual immorality, cruelty, callousness to human suffering, and a low standard of public opinion, were universal; traveling and communications were chancy and perilous; most people were illiterate. Many Christians today talk about the “difficulties of our times” as though we should have to wait for better ones before the Christian religion can take root. It is heartening to remember that this faith took root and flourished amazingly in conditions that would have killed anything less vital in a matter of weeks. These early Christians were on fire with the conviction that they had become, through Christ, literally sons of God; they were pioneers of a new humanity, founders of a new Kingdom. They still speak to us across the centuries. Perhaps if we believed what they believed, we might achieve what they achieved.
-J. B. Phillips, Letters to Young Churches, 1946
One of the oldest parchment manuscripts of the whole Bible (discovered in a monastery near what is believed to be Mt. Sinai in 1844) and dated to the 300s omits the verse in its original. This copy was also quite obviously later corrected to include the verse (written in on the margin or something). Another similar old parchment called Vaticanus (because it has been in the Vatican library since the 1400s) is considered the oldest copy of the whole Bible in existence and dates also to the 300s; it does not have the verse either. These are both careful and high-end copies of Scripture, and they are considered very reliable by most textual critics. Once you get into the 400s you get copies that have this verse and copies that don’t. So it seems reasonable to conclude that an extra verse got into some copies by the year 400 and is leaking into more and more.
We can understand psychologically why it would make sense for a person to be reluctant to drop something out and why an addition would start spreading. If you expect to read the words and you don’t see them, you tend to think that less can’t be right. If you don’t expect to read the words and yet you see them, you tend to think more is better. The result is than an omission usually does not tend to spread.
Here is an interesting thing that also happens. They can check the writings of the church fathers and see if they mention this verse. Eusebius, who lived from the 3rd to the early 4th century (300s) did not know about this verse. But all the guys from later on in the 4th and into the 5th did. That would be enough to surmise that after Eusebius and in the middle of the 4th century this reading was introduced.
Unfortunately, Origen (who didn’t make it out of the 3rd century and predates Eusebius) seems to have known about the verse, which could make the whole thing somewhat confusing! And on top of that it seems that the Diatessaron of Tatian, which dates to the 2nd century, had the verse also. So how can we know? These witnesses are actually less reliable, since they are just mentioning verses in passing and not copies of Scripture. Also, you have to remember that a copy of a book of Origen is not likely to be from Origen’s time: they are examining copies of copies, and there is always a chance that an older book gets harmonized to match the text the guy copying expects. So there is more to study there, but there is not enough evidence to throw out the strong likelihood of the verse being inserted in the middle of the 300s.
There are other places to look: the old translations of Scripture that we still have. It looks like the verse starts appearing in the 300s first in the Latin translations. There are Latin translations that omit it, however, along with translations into Syriac, Coptic, and Ethiopian. So that also suggests it was originally missing.
And here is the conclusion the experts draw: “Since there is no satisfactory reason why the passage, if originally present in Matthew, should have been omitted in a wide variety of witnesses, and since copyists frequently inserted material derived from another Gospel, it appears that most manuscripts have been assimilated to the parallel in Mk 9:29.” In other words, when someone was copying Matthew, knowing what it says in the parallel passage in Mark, he slipped what Mark says into Matthew, and it spread from there.
 Metzger, B. M., A textual commentary on the Greek New Testament, second edition a companion volume to the United Bible Societies’ Greek New Testament (4th rev. ed. Logos Bible Software), 35.