Peter said that Paul's writings are difficult to understand and easily distorted by those who don't already have a solid Scriptural education. He called them ignorant, unstable, and lawless. (2 Peter 3:15-17) Keep that in mind whenever Paul seems to be clear and straightforward. Verify what he wrote against what the rest of Scripture says.
Is God's Torah defined only by the five books of Moses? Does it also include oral traditions? Does it include all of the Jewish traditions as well as the complete set of all Sanhedrin rulings? Can a person be "saved" by obedience? Can a gentile convert be allowed into fellowship without being fully converted to Judaism, including having been circumcised? Or can gentile converts ignore Torah altogether? These were the questions over which Paul argued with the "party of the circumcision". (Acts 15)
The Letter to the Galatians wasn't written to Jews; it was written to formerly pagan gentiles. When Paul talks about them returning to slavery under "weak and worthless elementary principles of the world", he can't possibly be talking about God's Law. (Galatians 4:9) They weren't keeping the Law before, so how could they return to it? And how could he justify calling God's Law weak, worthless, or worldly, when the Bible says the opposite literally hundreds of times? (See Psalm 119 for a number of examples.) The Galatians were keeping the laws of false gods and of men before they met Paul, things that are truly weak, worthless, and worldly, so it seems logical that these are the things Paul meant.
The voluminous traditions of the scribes and Pharisees, the rules for ritual conversion to Judaism (although it wasn't called that at the time), the circumcision of grown men, extra-Biblical fasts and feasts...all of these things are the laws of men, not of God. Paul never taught against the Law of God, but he incessantly taught against the anti-God laws of men.
He also taught that obedience to God's Law was not necessary for salvation, and the Jerusalem Council clearly agreed with him. (Acts 15 and 21) The law can't do anything for a faithless sinner except to point out and prove his sin. That's a useful function, but it's not where the Torah truly shines. Although Paul taught that obedience to Torah was never a requirement of salvation, all of his teachings were founded on Torah. Every instruction he gave to the gentile congregations was based on the five books of Moses. He called Torah good, just, and holy.
In claiming that salvation was by faith and not by strict obedience to rules, whether God's or man's, he didn't nullify the Law, but he established it. (Romans 3) We, whose hope is in Yeshua rather than in ourselves or some mere prophet, establish God's Law as the light it was intended to be by walking it out in our lives. Not instantly or as a prerequisite for salvation, but learning it gradually, working out out our salvation through study, prayer, and by every day walking a little closer to God's standards with full faith in His mercy to forgive our inevitable missteps.
Fear God and keep His commandments, for this remains the whole duty of a righteous man. (Ecclesiastes 12:13)
See also The Multifacted Law of God, Does Acts 15 Say We Can Ignore God's Law?, and Choosing to Sit in a Prison of Your Own Making.