From The Gospel of Matthew by Curtis Mitch and Edward Sri, commenting on Matthew 22:40:
Jesus adds that the whole law and the prophets depend on these two commandments. Literally, the text says that the Torah and the Prophets “hang” on the double love commandment, as though these two precepts support the full weight of biblical religion in all of its various aspects. No other commandment of the Bible is properly observed if either one of these is transgressed or compromised. For the aim of all divine Scripture is to bring us out of ourselves to love and serve God and our fellow human beings.