Regarding the giving of the law to the children of Israel, when God took them out from Egypt through Moses, consider:
Exodus 19:3 And Moses went up to God, and the Lord called to him from the mountain, saying, “Thus you shall say to the house of Jacob, and tell the children of Israel: 4 ‘You have seen what I did to the Egyptians, and how I bore you on eagles’ wings and brought you to Myself. 5 Now therefore, if you will indeed obey My voice and keep My covenant, then you shall be a special treasure to Me above all people; for all the earth is Mine. 6 And you shall be to Me a kingdom of priests and a holy nation.’ These are the words which you shall speak to the children of Israel.”
We see the purpose of God concerning Israel there.
Galatians 3:19 What purpose then does the law serve? It was added because of transgressions, till the Seed should come to whom the promise was made; and it was appointed through angels by the hand of a mediator. ........... 23 But before faith came, we were kept under guard by the law, kept for the faith which would afterward be revealed. 24 Therefore the law was our tutor to bring us to Christ, that we might be justified by faith. 25 But after faith has come, we are no longer under a tutor.
Here we see the Law was given to bring them to Christ that they might be justified by faith. And that now that faith had come, those who were justified by faith, are no longer under the Law and are now in a new covenant with God, wherein the purpose of God spoken in Exodus 19:6 concerning Israel is being accomplished by God. For in the new covenant, having justified them through faith that has came, that is, Jesus Christ, God will transform them to the image of Jesus Christ, who is their High priest, and make them a kingdom of priests and a holy nation.
Tong
R1624