i didn't say it was not good. I said it appeared good to man as we can only see the outward works. We can't see your heart's intentions and motivation to, conclude that it was a good work. For all we know, you may have been visiting her to persuade her to include you in her will. We just don't know.
Jesus said, "if a man looks upon a woman with lust, he has already committed adultery in his heart". So that man is guilty in Gods view, while the men around him didn't even see his lust.
God did say that there are none righteous, no not one. That tells me our best works are as filthy rags in His sight, let alone our wicked works.