There is a certain righteousness that God rejects, and that is self-righteousness. When a man tries to be righteous by keeping the Ten Commandments, or by being a nice person, or doing good deeds, God rejects that righteousness.
Isaiah 64:6 says, “But we are all as an unclean thing, and all our righteousnesses are as filthy rags; and we all do fade as a leaf; and our iniquities, like the wind, have taken us away.” Now, why would God say that? Because God is holy and He cannot tolerate any sin. None whatsoever. Man is sinful at his best, and the best man can do is not enough. That’s the reason keeping the Ten Commandments can’t save you.
Number one, you can’t keep the whole law of God. Number two, even if you kept most of it, what good is that? If you are hanging over a fire by a chain of ten links and nine of them are forged steel and one of them is made of paper, how safe are you? That’s the reason God says, “For whosoever shall keep the whole law, and yet offend in one point, he is guilty of all” (James 2:10). God demands perfection, and we simply can’t supply it on our own.