Compare scripture with scripture, that’s the only way to come to a knowledge of the truth. Look at Deuteronomy 31:26 again and compare it side by side with Paul’s letter to the Colossians below:
Take this book of the law, and put it by the side of the ark of the covenant of Jehovah your God, that it may be there for a witness against thee.
Deuteronomy 31:26
having blotted out the handwriting in the ordinances that is against us, that was contrary to us, and he hath taken it out of the way, having nailed it to the cross;
Colossians 2:14
The Mosaic Law, by the side of the ark, was what was nailed to the cross, not the Ten Commandments, which were inside the ark, as can be seen from the text. Paul speaks about this again in Hebrews and Galatians:
For the law, having a shadow of the good things to come, not the very image of the things, can never with the same sacrifices year by year, which they offer continually, make perfect them that draw nigh.
Hebrews 10:1,4
For it is impossible that the blood of bulls and goats should take away sins.
But now, after that ye have known God, or rather are known of God, how turn ye again to the weak and beggarly elements, whereunto ye desire again to be in bondage?
Galations 4:9,10
Ye observe days, and months, and times, and years.
This only would I learn of you, Received ye the Spirit by the works of the law, or by the hearing of faith?
Galations 3:2,3
Are ye so foolish? having begun in the Spirit, are ye now made perfect by the flesh?
The Book of the Law, written by Moses, with its shadows and types, feast days, ceremonial sacrifices, and offerings, was unable to bring us back to our true state – the way we were before sin, in the Garden of Eden. Those sacrifices and ordinances – the blood of bulls and goats – were unable to truly take away sin and make us perfect.
The purpose was to separate a people holy to God, a unique nation that could partner with Him to show the world what life could be like. Unfortunately, instead of spreading the truth, they kept salvation to themselves, despite the fact that written in the Old Testament, salvation is for everyone. And then later, ultimately fell into idolatry and apostasy like their neighbors.
Even Peter temporarily fell back into old habits and began separating himself from eating with Gentiles. Paul had to call him out on it:
But when Peter was come to Antioch, I withstood him to the face, because he was to be blamed.
Galatians 2:11,12
For before that certain came from James, he did eat with the Gentiles: but when they were come, he withdrew and separated himself, fearing them which were of the circumcision.