AVID was not the only psalmist. Asaph was a psalmist... and a musician. Now, Psalm 73 is a record of a great struggle that raged within Asaph's heart. He wrestled with the age-old question concerning the prosperity of evil men and the relative weakness of those who are comparatively innocent. As Asaph admits to us how deep his inner battle really was, he begins in retrospect with his conclusion: "Truly God is good... too such as ore of a clean heart." To be sure, this is not where he started out...otherwise this psalm would never have even been written. The whole reason behind this psalm was that Asaph perceived conflicting evidence along the way in his journey through life; evidence which he interpreted as contradictions against his doctrine and theology.
Asaph very nearly "lost his faith" because of the success which he saw in the lives of ungodly men. Specifically, Asaph compared his own plight as a faithful servant of Jehovah to the ease which he saw in the lives of unbelievers. And, obviously it just made no sense to him. The climax of Asaph's philosophical crisis came when he initially concluded that he had cleansed his heart in vain (Psalm 73:13).
Verse 17 is a turning point in this Psalm. When Asaph went to worship God (despite his doubts and questions) he was shown the end of the story, and his doubts were quelled. Justice is not always immediate. This was his epiphany. His faith was notwasted. God's wrath would be poured out against the ungodly eventually and they would be destroyed. They would pay for their unbelief (Luke 16:25).