Galatians 3:10 – “For all who rely on works of the law are under a curse; for it is written, “Cursed be everyone who does not abide by all things written in the Book of the Law, and do them.”
Here Paul is loosely quoting from Deuteronomy.
“‘Cursed be anyone who does not confirm the words of this law by doing them.’ And all the people shall say, ‘Amen.’” (Deuteronomy 27:26)
In Galatians 3, Paul is refuting the false teaching of the Circumcision Party. They taught it was necessary to follow the customs of Moses ~ to be saved. (Acts 15:1, Galatians 2:4) In the very next verse, Paul lays out how justification really works.
“Now it is evident that no one is justified before God by the law, for “The righteous shall live by faith.” (Galatians 3:11 and reiterated in 3:14, 22 and 25-26)
Anyone relying on law-keeping ~ for justification ~ remains under a curse. Without faith in Jesus the Messiah, they are not yet pardoned from the penalty they have earned (the wages) for breaking God’s law (sin). The wages of sin is death. (Romans 6:23) The ‘curse of the law’ is the eternal death penalty. By contrast the gift of God is eternal life through Jesus Christ. (also Romans 6:23)
Since justification is only by faith, does that mean the law is no longer needed? It would if law-keeping could earn justification. But that was never the case.
“Is the law then contrary to the promises of God? Certainly not! For if a law had been given that could give life, then righteousness would indeed be by the law.” (Galatians 3:21)
One does not refrain from murder, adultery, theft and idol worship ~ to be justified. One refrains from these things because they now hold allegiance to Jesus as Lord of all. From that allegiance, born of faith and out of love, we follow the constitution of our Lord’s kingdom.