Psalm 30:5 (ESV)

5 For his anger is but for a moment, and his favor is for a lifetime. Weeping may tarry for the night, but joy comes with the morning.

This verse is difficult to interpret. We do not know why David was subjected to God’s anger. It is possible that David’s illness was intended as a lesson for David. He may have forgotten the seriousness of sin, and therefore God confronted him with the wages of sin, that is, death (Romans 6:23). However, God’s wrath is not the psalm’s central theme, as David knew that he could rely on his Father’s compassion.