Many were the purposes why God gave The Mosaic Law to Israel. One reason was to show God’s wisdom to the other nations so as to win respect and that they would turn to the One, Only True God. This happened on many occasions such as Uraiah the Hittite and probably the Pelethites who served under David later in his reign. Also the lineage of Christ contains Gentiles who turned to the Lord. Another reason for giving The Law was for societal and personal justice in Israel. However, the overarching purpose seems to be to show God’s righteousness and our sinfulness contrasted.
The Law acted to reveal our sinfulness and thus the sincere worshiper could bring a sacrifice which proclaimed the message from the beginning in (Gen. 3.15) that The Divine Man would provide the payment to redeem His people. Paul shows this condemnatory function of The Law clearly in 1Cor. 15.56 where he indicates: “the power of sin is the Law.” Also, Gal.2.19ff. “Through The Law I died to The Law, so that I might live for God…for if righteousness were through The Law, then Christ died for no purpose.”
Gal. 3.19 gives the reason for The Law: “Why then the law? It was added because of transgressions, until the seed [Christ] should come to whom the promise had been made.” Heb. 8.7-8 says The Mosaic Covenant pointed out the peoples’ sin: ” For if that first covenant had been faultless, there would have been no occasion to look for a second. For he finds fault with THEM when he says: ‘Behold, the days are coming, declares the Lord, when I will establish a new covenant with the house of Israel and with the house of Judah.'” (emphasis mine)
Jesus mentions the same truth when reproving the Jewish leaders: Do not suppose that I will accuse you before the Father. The one who accuses you is Moses, in whom you have placed your hope. (Jn. 5.45) Later in the account Jesus speaks to their inability to keep the Law: “Hasn’t Moses given you the law? Yet not one of you keeps the law” (7.19). These Pharisees that Jesus was primarily speaking to were extremely punctilious in their religious observance, yet they failed to keep The Law completely.
Further, The Law was perfect and whoever could keep it would live: “So you must keep my statutes and my regulations; anyone who does so will live by keeping them. I am the Lord.” (Lev.18.5) Additionally, Jesus quotes Leviticus to the Jewish expert in Lk. 10.25-28: “Now an expert in religious law stood up to test Jesus, saying, “Teacher, what must I do to inherit eternal life?” He said to him, “What is written in the law? How do you understand it?” The expert answered, “Love the Lord your God with all your heart, with all your soul, with all your strength, and with all your mind, and love your neighbor as yourself.” Jesus said to him, “You have answered correctly; do this, and you will live.”
No one ever kept The Law except Jesus who claimed this promise of whoever could keep The Mosaic Law would live forever in Lev.18.5. He earned life in His humanity and gives eternal life to those who trust Him. Yes, it is also true that Jesus could not sin but this does not take anything away from His righteous life. More could be said about He being perfected through suffering during His earthly life (it was for our sanctification). Also, Jesus died as a penal substitution and fulfilled all the sacrifices: guilt, sin, burnt, daily, and others. These considerations will have to be in other posts however.