God gives us His commandments so we may have a tangible way to express our love for Him and His glory. And the reality is, we don't truly understand God's first & greatest commandment (Matthew 22:34-38) until, by it, we are motivated to obey His other commandments as well.
There is a fear associated with the Ten Commandments. Many people have the wrong impression that they breed legalism and self-righteousness, but they do not. Pride breeds self-righteousness & legalism. If our heart is motivated to obey the greatest command (Love the LORD your God) then we will not be pursuing self-righteousness in our efforts to obey God, but instead we'll be pursuing to love God and bring glory to his great name.
The disconnect only happens when we lose focus in our efforts. When we aim to do good, for "goodness" sake, then we are on a path towards destruction. The error of the Pharisees was not that they were trying to do the "right" thing but instead that they were motivated more by making themselves look good to others (Mathew 23:1-36) then they were for loving God and bringing him glory.
What we are dealing with is a heart issue and one that can effect us all. The Ten Commandments are still very applicable to our lives today, but we must be careful that in our efforts to be obedient we are not motivated by a desire to make ourselves look holier than we really are. Any time we are motivated to obey in order to look good to others we are missing the point. There is none good but God (Mark 10:18) and any efforts we make towards obedience are a direct result of Christ's work in us and therefore should be done for the sole purpose of bringing God glory. This is a heart set on loving God instead of loving ourselves.
There's no need for Christians to distance themselves from the Ten Commandments. In fact, to do so would be a great danger towards our pursuit of holiness. Instead, Christians need to recognize the sinful desires of our hearts as well as many of our motivations...and turn towards Christ, the author and perfecter of our faith (Hebrews 12:2).
For His Glory,