God never intended for man to keep the Law, it was His way of revealing to man, not only His requirement for fellowship, but also the inability (even if desiring to) of the creature to do so. Perfect obedience to His will cannot be accomplished in the creature (man), in who dwells the sin nature (old man), even in regeneration.
Perfect obedience to God will be the walk of the Christian in eternity because of the absence of the sin nature, which will involve the absence of all hindrances to man’s ability to obey Him perfectly—in the Spirit. Jesus was the only human who could keep the law perfectly because it required, not only an uninterruptence (even in thought) of outward compliance of actions (impossibility with a sin nature—Jam 2:10), but an inward holiness of intentions in all things (performed only out of divinity—Jesus). The outward keeping of the law could be keep by any human—but not perfectly—and that was the point.
Jesus’ Law keeping was not so that His obedience would be accredited to the believer, but for Himself—for the qualifying of a perfect sacrifice, and it is the result of this atonement which is accredited (imputed) to the believer. Now, the believer’s obedience is in the life of Christ (Col 3:4) by the Spirit, and this is why godliness is imputed (not imparted due to the sin nature).