Not sure about the timeframe of the Psalm but it seems like David is not used to set backs. But, when there is sin in the house all in it become stained by its consequences.