It's called context, my friend. See verse 8.
The context of Hebrews 8 and the entire book of Hebrews is about the Levitical priesthood not the Torah itself. Paul wrote Hebrews encourage those who were worried about the possibility that the Temple would fall away and the Levitical priesthood with it.
Paul was telling his audience not to worry about the Levitical priesthood. Yeshua is the ultimate High Priest and we should look to His Priestly ministry for reconciliation with God.
There’s nothing in the Book of Hebrews which negates the Torah rules on morality, sanctification, etc.
All this reminds me of Peter’s warning about those who twist Paul’s words to antinomianism and lawlessness (torahlessness).
2 Peter 3:14-18 say, “Therefore, beloved, since you look for these things, be diligent to be found by Him in peace, spotless and blameless, and regard the patience of our Lord as salvation; just as also our beloved brother Paul, according to the wisdom given him, wrote to you, as also in all his letters, speaking in them of these things, in which are some things hard to understand, which the untaught and unstable distort, as they do also the rest of the Scriptures, to their own destruction. You therefore, beloved, knowing this beforehand, be on your guard so that you are not carried away by the error of unprincipled men and fall from your own steadfastness, but grow in the grace and knowledge of our Lord and Savior Jesus Christ. To Him be the glory, both now and to the day of eternity. Amen.”