We know that everything in the Law was written for those who are under its power. The Law says these things to stop anyone from making excuses and to let God show that the whole world is guilty.
If he became acceptable to God because of what he did, then he would have something to boast about. But he would never be able to boast about it to God.