An inheritance is something that is given by a parent to a child. It is not something that is earned—a man does not inherit his father's estate because of his own character, but because the estate passes from father to son. While it is certainly possible for a father to intervene and exclude a son from inheritance because of the life he is living, as a general rule the inheritance is not earned but is freely given.
Likewise, if the inheritance of this earth and eternal life came simply by obeying the law, the covenant with Abraham would have been very different. God would have told Abraham, "If you are perfect in all of your ways and never sin, then I will give you these things." While the agreement with Abraham was conditional—there was a part that Abraham had to play—it was not because of Abraham's strict obedience to a moral code that Christ came to confirm the promises.
Christ came for precisely the opposite reason: Because of the human heart, human nature, and sin, we cannot have access to God. His sacrifice allows us to be justified before God, not because of works, but because God has decided to justify us. After justification and the receipt of the Holy Spirit, then we are able to follow the intent of God's instructions through a process of sanctification. If we make it through this process of God recreating Himself in us, we will be resurrected and given the promises that were made to Abraham and his spiritual children—not because we were perfect in this life, but because God is faithful to His word.
David C. Grabbe