"The Scripture, foreseeing that God would justify the Gentiles by faith, preached the gospel beforehand to Abraham, saying, 'All the nations will be blessed in you.'" So then those who are of faith are blessed with Abraham, the believer. For as many as are of the works of the Law are under a curse; for it is written, 'Cursed is everyone who does not abide by all the things written in the book of the Law, to perform them.' Now that no one is justified by the Law before God is evident; for, "The righteous man shall live by faith.' However, the Law is not of faith; on the contrary, 'He who practices them shall live by them.' Christ redeemed us from the curse of the Law, having become a curse for us--for it is written, 'Cursed is everyone who hangs on a tree' -- in order that in Christ Jesus the blessing of Abraham might come to the Gentiles, so that we would receive the promise of the Spirit through faith" (Galatians 3:8-14).
Paul is contrasting the ideas of blessings and curses. A blessing is to desire good for someone or to give someone a benefit. A curse is to desire ill for another or to devote someone to punishment. Paul reminds us that God promised to bless everyone through Abraham. It comes not through direct lineage but through sharing a faith similar to the faith displayed by Abraham.
Yet, the Israelites, who directly descended from Abraham were under a curse because they were under a law that required its followers to keep every law perfectly, which no one is able to do. One of the problems that Paul deals with in the book of Galatians is the desire of Jews to pull the Gentile Christians into the Law of Moses. Paul argued, "We are Jews by nature and not sinners from among the Gentiles; nevertheless knowing that a man is not justified by the works of the Law but through faith in Christ Jesus, even we have believed in Christ Jesus, so that we may be justified by faith in Christ and not by the works of the Law; since by the works of the Law no flesh will be justified" (Galatians 2:15-16). Paul's argument here in chapter 3 is to ask why would you want to bind yourself under the curse of the Law?
Still, the question is how did the Jews bound under the Law's curse gain their freedom? The answer is that Jesus took on the ill (the curse) by dying on the cross. The Law declared that everyone who died by hanging, and dying on a cross is a form of hanging, is under a curse; that is, ill has befallen him. Jesus' ill-treatment and death on the cross purchased our freedom from both sin and the Law of Moses. As a result, the blessing of Abraham, which comes by faith, flows to all people allowing us to receive the promise of eternal life from the Holy Spirit.
Jesus was without sin. He did not become sinful while dying on the cross. Rather, he was treated as if he were a sinner, though he was innocent of any crime. His willingness to suffer punishment on our behalf purchased our freedom. As Albert Barnes eloquently wrote: "He consented to die the most shameful and painful death, as if he were the vilest malefactor, in order that the most guilty and vile of the human race might be saved."