I should also mention that the law is there to restrain the wickedness of those who don't have God's law written on their hearts.
"For the mind that is set on the flesh is hostile to God, for it does not submit to God's law;
indeed, it cannot. Those who are in the flesh cannot please God." - Romans 8:7-8
In the context of actually restraining wickedness and being an enforced code of conduct, the law was only given to Israel, God's people, to set them apart from pagans who didn't have the law. In a wider context, the law was given to all to act basically like Agent Cool Blue mouthwash -- it doesn't clean your mouth, it dyes the gunk that's already on your teeth blue so you can see how gunky your teeth are. The law exists to show us that we can't save ourselves.
"Now the law came in to
increase the trespass, but where sin increased, grace abounded all the more, so that, as sin reigned in death, grace also might reign through righteousness leading to eternal life through Jesus Christ our Lord." - Romans 5:20-21 (see also Romans 7)
"For God has done what the law, weakened by the flesh, could not do." - Romans 8:3
"Now if the ministry of death, carved in letters on stone, came with such glory that the Israelites could not gaze at Moses' face because of its glory, which was being brought to an end, will not the ministry of the Spirit have even more glory? For if there was glory in the ministry of condemnation, the ministry of righteousness must far exceed it in glory. Indeed, in this case, what once had glory has come to have no glory at all, because of the glory that surpasses it. For if what was being brought to an end came with glory, much more will what is permanent have glory." - II Corinthians 3:7-11
And let's not forget "For whoever keeps the whole law but fails in one point has become accountable for all of it" (James 2:10). Hard to run a government on a principle like that.
The law had a governmental aspect in the past for a season, but it is fundamentally soteriological (about salvation), pointing to the new covenant (Luke 24:44-47 and Romans 3:21ff, for starters).
And there is quite a bit in the Bible about the government's enforcing morality, in the first five books. If they're not relevant, then why bother including them in the Bible?
They were applicable in the old covenant. The old covenant is relevant to our understanding of the new covenant.
The Bible also has God ordering Noah to build an ark. Does that mean we should all build arks? All of the Bible is relevant to us today and should be read and understood, but not all of it directly applies to us today.