The words of Jesus are a summary of the Decalogue.
Man needs moral rules to be broken down, so he is capable of knowing what is the difference between right and wrong. In this regards, a summary or the Decalogue just does not do that.
Secondly, it was God’s intention, to have his only Begotten Son explain the the meaning of the Decalogue in as way that exemplifies his wisdom in front of the Pharisees.
The Scriptures show us on more than one occasion that Our Lord astonished the Jewish community with his knowledge, learning and miracles:
God the Father desired his Divine Son to be the one to truly enlighten all of mankind.
But the Pharisees, hearing that he had silenced the Sadducees, came together. - Matthew 22:34
But the Pharisees hearing. The theological attack. The Pharisees had been overcome in their political assault, but seeing the admiration of the multitude for the answers of Jesus, they feel bound to destroy our Lord’s authority by confounding him in public. “Silenced,” according to the Greek text, might be rendered “muzzled” [cf. Deut. 25:4; 1 Cor. 9:9; 1 Tim. 5:18]. “The Pharisees … came together” in order to deliberate about their course of action [cf. Ps. 2:2]; the result of this council is given in the words “and one of them”; for they agreed to depute a delegate instead of approaching Jesus in a body. “A doctor of the law” occurs only here in the first gospel, while the third gospel employs the term more frequently; etymologically considered, the Greek word for “doctor of the law” denotes one learned in the law, while “scribe” denotes one versed in Scripture. Hence some think that the scribes explained the law in the synagogues, while the doctors explained it in the schools and in private assemblies, or that the scribes explained matters of doctrine, while the doctors taught matters of practice [cf. Calmet], or that the scribes explained the Haggada, while the doctors were concerned with the Halacha [cf. Schanz]; but since the Scripture and the law were practically identical for the Jews [cf. Jn. 10:37; 15:25; 7:49; 12:34; 1 Cor. 14:21], the doctors of the law must have been identical with those learned in the Scriptures, a conclusion that is confirmed by Mk. 12:28, where the “doctor of the law” is called “one of the scribes,” and also by Lk. 11:52, 53, where the two titles are indiscriminately applied to the same class of persons [cf. Knabenbauer].
And one of them, a doctor of the law, asked him, tempting him: Master, which is the great commandment in the law? - Mathew 22:35-36
“Tempting him” appears to contradict the second gospel [Mk. 12:32, 33], in which the scribe seems to have been sincere in his question; the discrepancy cannot be explained by contending that the Pharisees acted hypocritically, while their representative was fully sincere [cf. Paschasius, Sylveira, Schanz], nor by maintaining that the questioner tempted Jesus in a good sense, as the queen of Saba had tempted Solomon [cf. 1 Kings 10:1; Lam. Augustine De cons. evang. ii. 73, 141; Lapide], for both these explanations do violence to the text of St. Matthew. The scribe may have come with an evil intention, and may have been changed or perhaps wholly converted after the answer of Jesus [cf. Chrysostom, Augustine, Theophylact, Euthymius, Paschasius, Thomas Aquinas, Dionysius, Salmeron Sylveira]. The Jewish doctors enumerated 613 commandments [cf. Surenhusius, p. iv. p. 291], 248 of which were positive [equal to the number of bones in the human body], and 365 negative [equal to the number of days in the year]. These commandments were distinguished into great and small ones [cf. Schöttgen, Wünsche, Wetstein, ad v. 19], but practically it was hard to decide whether a given precept was great or small. The Greek text admits a double interpretation: first, what kind of commandment is a great one in the law, a question inquiring after the criterion according to which a great commandment might be distinguished from a small one [cf. Arnoldi, Schegg, Bisping, Schanz, Meyer, Weiss]; secondly, which particular precept is the greatest in the law, an interpretation favored by our Lord’s answer and the parallel text of the second gospel [Mk. 12:28]. Both points were much disputed among the Jewish doctors, so that Jesus could not answer the question in either sense without incurring the odium of some of the doctors.
Jesus said to him: Thou shalt love the Lord thy God with thy whole heart and with thy whole soul and with thy whole mind. This is the greatest and the first commandment. - Matthew 22:37-38
Jesus escapes the snare by drawing attention to the great principles of morality, instead of entering into the Rabbinic discussions on the ceremonial law; for no Jewish doctors could under any circumstances have denied the paramount importance of the moral obligations that were the soul of all external observances. The law which Jesus cites is taken from Deut. 6:5; according to the first gospel we read “with thy whole mind” instead of the original “with thy whole strength,” while Mk. 12:30 and Lk. 10:27 combine the expressions of Deut. and St. Matthew, reading “with thy whole mind, and with thy whole strength,” and “with all thy strength, and with all thy mind.” The verb “love” in both Greek and Latin text denotes the love of esteem rather than the love of affection. The manner of love described by the evangelists has found various explanations: first, the single clauses express different faculties or parts of man, but nearly every commentator of note has his own manner of explaining them [cf. Origen, Opus Imperfectum, Thomas Aquinas, Theophylact, Alb. Dionysius, Cajetan, Salmeron, Sylveira]; secondly, the “heart” denotes our will, the “soul” the lower faculties, the “mind” our whole way of thinking and willing, so that we must love God with our whole will, and with our lower faculties, and in both ways we must love him completely or with all our strength [cf. Augustine De doctr. christ. i. 22; Opus Imperfectum, Salmeron, Jansenius, Knabenbauer]; thirdly, the different clauses only indicate that our love for God must be supreme, i. e. that we must not adhere to anything contrary to God, that God alone must be our last end, that he must be our greatest good in appreciation at least [cf. Maldonado, Lapide, Jansenius c. 81, comment. in concord. evang.].
And the second is like to this: Thou shalt love thy neighbour as thyself. On these two commandments dependeth the whole law and the prophets. - Matthew 22: 39-40
“And the second” commandment in dignity as well as in width “is like to this”; because man must be loved as being the image of God [Origen, Opus Imperfectum, Alb. Thomas Aquinas, Faber Stapulensis, Dionysius], so that the love of our neighbor extends as far as the likeness of God extends [cf. Tostatus quæst. 278, in c. xxii.; Sylveira]. “Thou shalt love thy neighbor as thyself” requires first, that we must love the neighbor for the same motive for which we love ourselves; secondly, that we must wish our neighbor the same kind of good we desire for ourselves [cf. Augustine De vera relig. xlvi. 87; Maldonado, Mt. 7:12]. Then Jesus adds the reason why the two foregoing precepts are the greatest: “On these two commandments dependeth” [cf. Is. 22:23–25] “the whole law and the prophets,” i. e. the whole moral law; for these two laws contain all other moral laws [cf. Theophylact, Rabanus, St Bruno], they are the end of all other laws [cf. 1 Tim. 1:5; Rom. 3:19; Alb. Thomas Aquinas, Cajetan], they are the motives for the observance of all the other laws [cf. Dionysius, Lapide], and they give the form to all morally good actions [cf. Rom. 13:10; Alb. Thomas Aquinas, Cajetan].