I thought it was a real vain thing …
I may think it is a real vain thing that I did good to him
Because even though I did good to him, he paid me back evil for good (1 Sam 25:21).
But in the meantime God is good to me and gives me precious grace that I have never expected.
(In the case of David, he got Abigail, a wise woman, as his wife.
And because of her, he didn’t sin against God.)