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, NRSV).
This is necessary because "everyone who sins breaks the law; in fact, sin is lawlessness" (1 John 3:4, 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) so "that He, by the grace of God, might taste death for everyone" (Hebrews 2:9).
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).
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). 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.