The purpose was that the blessing of Abraham would come to the Gentiles in Christ Jesus, so that we could receive the promise of the Spirit through faith.
Brothers, I'm using a human illustration. No one sets aside even a human covenant that has been ratified, or makes additions to it.
References for Galatians 3:15
Now the promises were spoken to Abraham and to his seed. He does not say "and to seeds," as though referring to many, but and to your seed, referring to one, who is Christ.
References for Galatians 3:16
And I say this: the law, which came 430 years later, does not revoke a covenant that was previously ratified by God, so as to cancel the promise.
References for Galatians 3:17
For if the inheritance is from the law, it is no longer from the promise; but God granted it to Abraham through the promise.
Why the law then? It was added because of transgressions until the Seed to whom the promise was made would come. [The law] was ordered through angels by means of a mediator.
References for Galatians 3:19
Now a mediator is not for just one person, but God is one.
Is the law therefore contrary to God's promises? Absolutely not! For if a law had been given that was able to give life, then righteousness would certainly be by the law.
But the Scripture has imprisoned everything under sin's power, so that the promise by faith in Jesus Christ might be given to those who believe.
References for Galatians 3:22
Before this faith came, we were confined under the law, imprisoned until the coming faith was revealed.
The law, then, was our guardian described such a slave. This slave was not a teacher. until Christ, so that we could be justified by faith.
References for Galatians 3:24