Was the Law perfect, holy and righteous when God first gave it?
Yes. The Law, in its full purity as God first gave it, was perfect, holy, and righteous. Its original righteousness was flawless. However, the Galatian error was returning to the Law for bondage, because believers are now under grace, and the righteousness of the Law is fulfilled in those in Christ.
Les explains that Galatians 4 describes the Law as weak and beggarly elements and bondage, and Paul's thrust was to show Gentile believers in Galatia they were not under the Mosaic Law but under grace. Yet when he returns to Romans 8, he affirms that the righteousness, or full purity, of the Law as God first gave it was perfect, holy, and righteous. That righteousness is now fulfilled in believers who have their position in Christ by believing the Gospel; having experienced salvation, they are not to go back under the Law.
That the righteousness of the law might be fulfilled in us, who walk not after the flesh, but after the Spirit.
More Questions
Why could the law not do what God required?
What the law could not do, it could not do because it was weak from the fleshly side, from man's point of view.