Paul makes it clear in Romans 7:12 that the law is 'holy and just and good'. But the problem lies in flesh : in me, that is in my flesh there dwelleth no good thing, Romans 7:18.
Flesh and blood does not inherit the kingdom of God, as saith Paul, 1 Corinthians 15:50. But nor does flesh and blood possess goodness, in and of itself. It is just flesh.
By attempting to live, and to sustain life (that is to say spiritual life as opposed to mere organic life) humanity discovers - as did Adam and Eve - that the knowledge of good and evil is useless to humanity since the flesh and blood with which humanity attempts to acquire, retain and obey such knowledge - is weak.
The weakness lies not in the law itself. The weakness is in the flesh through which the law would work. But it does not work through flesh. For there is no inherent goodness in flesh. It is just flesh.
By reaching for the tree of knowledge of good and evil, humanity failed. And not only failed but sinned, for humanity contradicted the witness that God himself had given, warning that that was not the way for humanity to live.
The tree of Life was in the midst. That is the way of life.
The word of God : the words he uttered in the garden. My words : they are spirit and they are life, John 6:63. The Word of truth, 2 Timothy 2:15. The Word of Life, 1 John 1:1.
And by the word of God, the truth of God, is a way of Spirit, not flesh. And they that walk in the Spirit are not condemned. But they who follow after the knowledge of good and evil are condemned. For flesh and blood can do nothing to bring forth good out of itself.
There is therefore now no condemnation to them which are in Christ Jesus, who walk not after the flesh, but after the Spirit. [Romans 8:1 KJV]
The man who applies to law finds, in the end (if he is an honest and sincere man) that he is, indeed, a wretched man, craving deliverance.
O wretched man that I am! Who shall deliver me from the body of this death? [Romans 7:24 KJV]
But, thank God, there is a better path, a more sure way :
I thank God through Jesus Christ our Lord. So then with the mind I myself serve the law of God; but with the flesh the law of sin. [Romans 7:25 KJV]
But in the gospel, in a way of faith, Paul can pray :
For this cause I bow my knees unto the Father of our Lord Jesus Christ ... That he would grant you, according to the riches of his glory, to be strengthened with might by his Spirit in the inner man; [Ephesians 3:14,16 KJV]
For in the Spirit, not in the flesh, in faith and not in works, in the gospel and not in the law, they shall be so strong, in might, by the Spirit of holiness in the inner man of faith, the new humanity in Christ : and not the outer, decaying humanity of flesh, which goes, quite rightly, to its grave.