Here is the reason: Without law there would be no need for grace. The word grace, as the Greek word charis is translated in the New Testament, means freely shown "favor"—a gift (it's from charis that we derive the English word charity). In a religious context the word grace is used most often for the gift of forgiveness. It refers to how God extends His favor to repentant sinners by forgiving their former disobedience of His law—their "sins previously committed" (Romans 3:25 Romans 3:25Whom God has set forth to be a propitiation through faith in his blood, to declare his righteousness for the remission of sins that are past, through the forbearance of God;
American King James Version×, NRSV).
This is necessary because "everyone who sins breaks the law; in fact, sin is lawlessness" (1 John 3:4 1 John 3:4Whoever commits sin transgresses also the law: for sin is the transgression of the law.
American King James Version×, NIV). If there is no law to break, there is no such thing as sin. And if there is no sin the very idea of grace, as God's forgiveness, has no meaning at all.
God does not just dismiss our sins, our lawless acts. Nor does He simply ignore them. Rather, "Christ died for our sins according to the Scriptures" (1 Corinthians 15:3 1 Corinthians 15:3For I delivered to you first of all that which I also received, how that Christ died for our sins according to the scriptures;
American King James Version×) so "that He, by the grace of God, might taste death for everyone" (Hebrews 2:9 Hebrews 2:9But we see Jesus, who was made a little lower than the angels for the suffering of death, crowned with glory and honor; that he by the grace of God should taste death for every man.
American King James Version×).
In other words, it was to make God's favor—His grace—available to all who repent (by turning away from sin) that Jesus "gave Himself for us, that He might redeem us from every lawless deed and purify for Himself His own special people, zealous for good works" (Titus 2:14 Titus 2:14Who gave himself for us, that he might redeem us from all iniquity, and purify to himself a peculiar people, zealous of good works.
American King James Version×).
Therefore, grace encompasses more than just the forgiveness for past sins. It also includes the gift of the Holy Spirit to help us obey God's laws. Indeed, it refers to all the free and unmerited gifts of God. It includes His help in initially turning us away from sin and leading us to His truth and way of life, His forgiveness of our past sins and ultimately His granting us the greatest gift of all—eternal life in His Kingdom.
But without law, grace would be meaningless because there would be no way to define sin. Yet without grace, forgiveness of sin for breaking God's law could not be made available to us.
So Jesus died and rose again to make grace available to anyone who is eager and willing to "go and sin no more" (John 8:11 John 8:11She said, No man, Lord. And Jesus said to her, Neither do I condemn you: go, and sin no more.
American King James Version×). Through grace, we can first be forgiven of our lawbreaking and then enabled by the Holy Spirit to obey God's law from the heart—with the ultimate goal and promise of being able to live for all eternity in perfect obedience.
Thus, law and grace are utterly inseparable. Law is necessary to define sin and its consequences. Grace is necessary so sinners can be forgiven and led to obedience to God through the power of the Holy Spirit and the assistance of Jesus Christ, who is our Savior and High Priest.