tl;dr: The Law isn’t law for us, but it *is* wisdom literature!
In my early Bible classes growing up, I was taught that there were three divisions to the Torah: moral, ceremonial, and civil. It wasn’t until seminary that I realized that as helpful as those categories sometimes can be, they are not organic to the Torah — you’ll search the Torah itself in vain for any such division. In the actual books of Moses, the Law is presented as a whole, and you can die for murder, gathering sticks on the Sabbath, or offering strange fire on the altar.
Therefore, when Paul says that we are not under the Law, he doesn’t mean just the ceremonial portions. He means the whole thing. The Law is a whole, and we are not under the Law as a rule of life, period. No part of it.
That said, Paul also says the Law is holy and just and good, and if you’re having trouble seeing that, then pray Psalm 119:18: “Open my eyes, that I might see wondrous things in Your Law.” We’re supposed to be singing the Psalms in the New Covenant anyway (see Eph. 4:18-21, Col. 3:16, Jas. 5:13), so this is a good start! Jesus Himself, and the NT writers who followed Him, all made great use of the Law in making spiritual and moral arguments. Paul does the same (see, for example, 1 Cor. 9:9, 14:34, 1 Tim. 5:18). So while we’re not under the Law as a rule of life, Paul continues to appeal to it. Why?
Because it’s holy and just and good. It reveals God’s character, and the truths thus revealed apply to our situation, even if we’re not in ancient Israel and aren’t going to do exactly what they did. So Paul borrows a command about how Israelites treat their oxen to make an analogy to how the church treats its elders.
Likewise, since we’re in possession of a civil law code created by Almighty God Himself, nothing could be sillier than to ignore it in our pursuit of the common good. He made it for Israel, not for us in the Gentile nations, but He says He made it for us to marvel at.
“Surely I have taught you statutes and judgments, just as the Lord my God commanded me, that you should act according to them in the land which you go to possess. Therefore be careful to observe them; for this is your wisdom and your understanding in the sight of the peoples who will hear all these statutes, and say, ‘Surely this great nation is a wise and understanding people.’ For what great nation is there that has God so near to it, as the Lord our God is to us, for whatever reason we may call upon Him? And what great nation is there that has such statutes and righteous judgments as are in all this law which I set before you this day?” (Deut. 4:5-8)
If we’re looking at the Law and all we have to say is, “Thank goodness we’re not under that!” then we’ve missed something crucial. We ought to be asking how we can appropriate that wisdom and apply it well in our own situations.