You're confusing the OT law with the Law of Christ....
Christ spent his ministry teaching his followers to obey the Mosaic Law by word and by example, so I don't see a good reason to think that the Law of Christ is something other than or contrary to what Christ taught. God is not in disagreement with Himself about which law we should follow, so the Law of Christ is the same as the Law of the Spirit and the Law of the Father, which was given to Moses. In 1 Corinthians 9:21, Paul used a parallel statement to equated the Law of God with the Law of Christ, and the Bible refers to the Law of Moses as the Law of God in verses like Nehemiah 8:1-8, Ezra 7:6-12, and Luke 2:22-23..
In the New Testament, many mentions of “the law” is actually referring to Law of Christ (aka the Law of Liberty) and is not talking about the old testament law. Christians are NOT called to keep or live under the old testament law, but we ARE called to live under the Law of Christ.
The Law of Moses is perfect (Psalms 19:7), it is of liberty (Psalms 119:45), and it blesses those who obey it (Psalms 119:1-3), so when James 1:25 speaks about the perfect law of liberty that blesses those who obey it, he was not saying anything about the Law of Moses that was not already said in the Psalms. In Jeremiah 31:33, the New Covenant involves God putting the Mosaic Law in our minds and writing it on our hearts, and in Ezekiel 36:26-27, it involves the Spirit leading us to obey it.
Ultimately this means we are called to abide In Christ which is living after the Spirit and not after the flesh, or to be spiritually minded and not carnally minded (see Romans 8). As we see in Romans 8, to be spiritually minded is life and peace but to be carnally minded is death which is separation from the Lord.
Christ walked in obedience to the Mosaic Law, and in 1 John 2:6, those who abide in Christ are obligated to walk in the same way he walked. In Romans 8:4-7, those who walk in the Spirit are contrasted with those who have minds set on the flesh who are enemies of God who refuse to submit to the Law of God, which again refers to the Law of Moses.
Law of Christ
The phrase "the law of Christ" appears only in Galatians 6:2, although it is implied by the wording of 1 Corinthians 9:21 as well. In both places, its precise meaning is difficult to fix. In Galatians, Paul argues vigorously that the law given at Sinai makes no claim on those who believe in Christ, whether Gentile or Jew ( 2:15-21 ; Galatians 3:10-14 Galatians 3:23-26 ; 4:4-5 ; 4:21-5:6).
Galatians should not be interpreted as Paul speaking against following Christ. In Acts 5:32, the Spirit has been given to those who obey God, so obedience to God is part of the way to receive the Spirit, however, Galatians 3:1-2 denies that "works of the law" are part of the way to receive the Spirit, therefore that phrase does not refer to obedience to God. Furthermore, in Romans 3:27-31, Paul contracted a law of works with a law of faith, so works of the law are of works while he said that our faith upholds God's law, so it is of faith, and a law that our faith upholds can't be referring to the same thing as the works of the law that are not of faith in Galatians 3:10-14.
In Galatians 3:16-19, a newer covenant does not nullify the promise of a covenant that has already been ratified, so the New Covenant does not nullify our need to obey the Mosaic Law in connection with the promise. In Matthew 7:23, Jesus said that he would tell those who are workers of lawlessness to depart from him because he never knew them, so in regard to Galatians 3:20-25, the Mosaic Law leads us to Christ because it teaches us how to know him, but it does not lead us to Christ so that we can we can then reject what he taught and go back to living in sin.
In Galatians 3:25-29, every aspect of being children of God, through faith, in Christ, and children of Abraham and heirs to the promise is directly connected with living in obedience to the Mosaic Law. In 1 John 3:4-10, those who do not practice righteousness in obedience to the Mosaic Law are not children of God. In 1 John 2:6, those who are in Christ are obligated to walk in the same way he walked. In Matthew 23:23, Jesus said that faith is one of the weightier matters of the Mosaic Law. In John 8:39, Jesus said that if they were children of Abraham, then they would be doing the same works that he did, and the works that they should be doing were in obedience to the Mosaic Law.
If God freed the Israelites out of bondage in Egypt in order to put them under bondage to the Mosaic Law, then it would be for bondage that God sets us free, however, Galatians 5:1 says that it is for freedom that God sets us free, so you are not correctly identifying what Paul is speaking against in Galatians. It should not make sense to you to interpret Galatians as speaking against obeying God's commands.
He then appeals to the Galatians to engage in ethical behavior by walking in the Spirit ( 5:16 Galatians 16 ), being lead by the Spirit ( 5:18 ), and fulfilling "the law of Christ" (ho nomos tou Christou) through bearing one another's burdens ( 6:2 ). In 1 Corinthians 9 Paul demonstrates how Christians should, out of love for the weaker brother or sister, refrain from demanding their rights.
In Galatians 5:19-23, everything listed as works of the flesh that are against the Spirit are also against the Mosaic Law while all of the fruits
It seems fairly clear from these two texts that Paul uses the phrase to mean something other than the law given to Israel at Sinai and considered by most Jews to be their special possession. Help is found in the prophets. In Isaiah 42:1-4 we read that God's chosen servant will one day establish justice throughout the earth and that "the coastlands will wait expectantly for His law" (NASB).
The Mosaic Law was not given to Israel so that they would deprive the nations of getting to keep it, but in order to equip them to be a light and a blessing to the nations by turning them from their wickedness and teaching them to keep it in accordance with the promise and with spreading the Gospel. The coastlands should eagerly expect the Mosaic Law instead of rejecting it.
Jesus' teaching, although standing in continuity with the law given at Sinai, nevertheless sovereignly fashions a new law. In some instances Jesus sharpens commandments ( Matt 5:17-48 ) and in others considers them obsolete ( Mark 7:17-19 ). On one occasion, having been asked to identify the greatest commandment, Jesus concurs with the Jewish wisdom of his time ( Mark 12:32-33 ) that the greatest commandments are to love God supremely and to love one's neighbor as oneself ( Mark 12:28-31 ). He breaks with tradition, however, by defining the term "neighbor" to mean even the despised Samaritan ( Luke 10:29-37 ).
In Deuteronomy 4:2, it is a sin to add to or subtract from the Mosaic Law, so Jesus did not fashion his own law, but rather the sum of everything taught by word and by example was in regard to how to practice Judaism in obedience to the Mosaic Law. For example, everything that Jesus taught in Matthew 5 was rooted in the OT. In Mark 7:17-19, Jesus was speaking against being made common by eating bread with unwashed hands, which has nothing to do with making any of his eternal commands obsolete. In Matthew 22:36-40, Jesus said that all of the other commandments hang on the greatest two commandments, so if you think that the greatest two commandments should be obeyed, then you should also think that we should obey all of the commandments that hang on them. Jesus clarifying what it means to love our neighbor was not making changes to the Mosaic Law.
Paul believed that the life, death, and resurrection of Jesus Christ marked the beginning point of God's new covenant ( 2 Cor 3:1-18 ; Gal 4:21-31 ; cf. Rom 8:2 ). Like Isaiah, he believed that this covenant included the Gentiles ( Gal 3:7-20 ), and like Jeremiah he believed that it offered Israel a remedy for the curse that the old Sinaitic covenant pronounced on Israel's disobedience ( Gal 3:10-13 ).
In Jeremiah 31:31, the New Covenant was only made with the house of Judah and the house of Israel, so it is only through faith in Christ that Gentiles are able to partake of the New Covenant through becoming joined to Israel. The only way out from being cursed living in disobedience to the Mosaic Law is through repenting and returning to obedience to it through faith in Christ.
In light of this, Paul may have understood the teaching of Christ as a new law. If so, then the correspondence between the ethical teaching of Jesus and Paul on many points (e.g., 1 Cor 7:10-11 / Mark 10:2-9 ; 1 Cor 9:14 / Luke 10:7 ; Rom 14:1-23 / Mark 7:18-19 ) is a matter of Paul's intention rather than happy accident. Paul's own admonition to fulfill the law of Christ by bearing one another's burdens provides both a pithy restatement of Jesus' summary of the law and an indication that Jesus' teaching fulfills prophetic expectations.
Christ did not teach any brand new laws, but spent his ministry teaching to obey the Mosaic Law by word and by example.