We don't know that a Jesus character said that. That quote was written by an anonymous Greek scholar circa 90 CE, some 60 years after Jesus is purported to have been crucified. Nothing Jesus said was ever written down by anybody from that era so how could the writers of Matthew know Jesus said that?
Let me remind the readers that we have absolutely NOTHING that can be tied to Jesus' existence. He left no writings, no artifacts, there are no reliefs, no busts, no sculpts, no mention by any historians from that period--and all this includes the apostles--nothing! People who want to throw away their lives believing in a character for which there isn't a nickel's worth of evidence he ever existed are perfectly free to do so, but remember: you only get one life and then it's over. Live it wisely. Don't throw it away on fairytales.
If God really wanted is to believe in Jesus, God would have left enough evidence behind as tall as a mountain. But God didn't. He didn't even leave behind an anthill. All he left behind were four anonymous tales of a prophet named Jesus that were written half a century to a century after Jesus' supposed death that are filled with errors in geography, conflicting details, wrong genealogies, materials inserted 500 years later, and many more discrepancies. These are not perfect accounts. In fact they are so badly written as a whole that historians won't even take them seriously as reliable historical documents.