In response to Bildad's claim that man cannot be righteous, Job leads him into a study of wisdom. He likens it to mining for precious metals and jewels. It takes a lot of digging and earth moving to acquire wisdom.
But you have to know which hill or mountain contains what you seek. God knows where wisdom dwells. Job takes his friends to the fear of God for wisdom.
Wisdom would tell you that there is reward in virtue itself. The list of virtues Job continues with are nothing without the fear of God as their root.
Doing good for the sake of doing good is laudable. When we do good in an effort to manipulate the benevolence of the Lord, that is something else again. God sees the motives as well as the actions.
God's judgment of the motives of men reassures me that when I fail, he will see that my intent was pure. He recognizes that the people He created are fallible, imperfect, prone to sin. He sees the heart, not just the actions.
When we act out of love for God and fall short, we are not judged for our imperfection, but for our intentions. If perfection were a requirement, none of us could stand. But fear of the Lord and love of God are the keys to our right standing with God.
Preserve us from the folly of trusting our own intellects. Grant us Your constant presence in the Holy Spirit as our guide and teacher.
In Jesus' most precious name.