More specifically, David promised God that he would guard his life and his court from sin. Worthless or vile things are things that make no positive contribution to godliness. Like God, David professed to hate departure from the right way. A perverse heart means a crooked or twisted affection, namely, one that turns away from the straight path of rectitude. [source][source][source]