What is the meaning of Psalm 73:13?

Verily I have cleansed my heart [in] vain, and washed my hands in innocency. (Psalm 73:13 KJV)

Surely in vain have I cleansed my heart, And washed my hands in innocency; (Psalm 73:13 ASV)

Truly have I purified my heart in vain, and washed my hands in innocency: (Psalm 73:13 DBY)

Surely in vain I have cleansed my heart, and washed my hands in innocence, (Psalm 73:13 WEB)

Only–a vain thing! I have purified my heart, And I wash in innocency my hands, (Psalm 73:13 YLT)

Interlinear

Verily I have cleansed <zakah> my heart <lebab> in vain, <riyq> and washed <rachats> my hands <kaph> in innocency. <niqqayown> (Psalm 73:13 KJV)

Matthew Poole’s Commentary

Verse 13. Hence I was sometimes tempted to think that religion was a vain and unprofitable thing, at least as to the happiness of this life, which yet God had promised as a reward to piety. True religion is here fitly and fully described by its two principal parts and works, the cleansing of the heart from sinful lusts and passions, and of the hands, or outward man, from a course of sinful actions, And although it be God’s work to cleanse the heart, yet he saith,  

I have cleansed it, because every good man doth co-operate with God’s grace in cleansing it. Compare 2Co 6:1; 7:1.  

Washed my hands in innocency, i.e. kept my hands (the great instruments of action, and consequently the rest of the members of my body) innocent and pure from evil practices. I have washed my hands, not only ceremonially with water, wherewith hypocrites satisfy themselves, but also morally, or with the waters of God’s grace and Spirit, innocency or purity.