God’s law is perfect. Anything God does is perfect. It is man that is imperfect; not the other way around.
3 For what the law could not do, in that it was weak through the flesh, God sending his own Son in the likeness of sinful flesh, and for sin, condemned sin in the flesh: 4 That the righteousness of the law might be fulfilled in us, who walk not after the flesh, but after the Spirit. Romans 8:3-4
No one ever (except Jesus Christ) has ever lived up to the every jot and tittle of the law. Jesus understood that sin in the flesh was something not authored, promised or provided by God (condemned- meaning not in any way useful to God in His love for mankind). To be in the flesh was to live from the seat of the self, instead Jesus lived unto God in the spirit.
Everybody born has soul (mental, emotional) and a body. From the time of birth man continues to learn and develop habits that contribute to the soul as well as the body. Upbringing, education, and experiences, heredity and emotions all are inputs that define the carnal or fleshy nature. The flesh in and of itself is not sinful but it can be useful to the the adversary of God. The flesh nature can be pushed into making comparisons, gossiping, seeking power and status over others and destruction. It can harbor pride, resentment, depression, jealousy and immorality.
When a person receives the spirit of God (Romans 10:9-10), a third dimension is added and man becomes body, soul and spirit. That spirit is a gift from God. It is power, it is love and it is a sound mind. We have the opportunity to walk in the spirit. The spirit can rule over the soul, as the soul provides for the body. It is in understanding this relationship that man can truly walk with God and be free of all the impediments of the fleshy nature and actually glorify God and walk in His power.