When God spoke these words through Moses He had just made a covenant with Israel. The Mosaic Covenant was His gracious way of allowing a sinful person to approach His holiness. Despite the many external rules and rituals, the basis of the Covenant was internal. God knew the right motivation would lead people to obedience.
“And now, Israel, what does the Lord your God require of you, but to fear the Lord your God, to walk in all His ways and to love Him, to serve the Lord your God with all your heart and with all your soul, and to keep the commandments of the Lord and His statutes which I command you today for your good?
Israel was unable to keep the Mosaic Law, so in God’s eternal plan of redemption He gave them the New Covenant through which His righteousness would be a free gift through faith in Yeshua.