In verse 25, it was said: وَإِنَّ لَهُ عِندَنَا لَزُلْفَىٰ وَحُسْنَ مَآبٍ (and surely he has a place of nearness in Our presence, and an excellent resort.). By concluding this event on this verse, a hint was released towards the fact that, no matter whatever the slip of Sayyidna Dawud (علیہ السلام) would have been, once he had sought forgiveness from Allah and had passionately turned to Him, it goes without saying that the level of his communion with Allah Ta’ ala had increased further.
When warn, warn with wisdom!
Yet another aspect of this event needs to be mentioned here. Let this slip of Sayyidna Dawud (علیہ السلام) be whatever it was, it was a matter between him and his Lord who could have alerted him to it even directly through a revelation. But, rather than do something of this nature, why was a particular method used when the case of a dispute was sent in his court to alert him thereby? The truth of the matter is that this method invites deliberation. It helps us realize that it provides guidance for those who are engaged in preaching and bidding the Fair and forbidding the Unfair. Those who do their duty in this field should know that the conduct of a person is not to be corrected casually. It takes a lot of wisdom to do it. To alert someone to his error, it is better to take to a method that helps the concerned person realize his error on his own, without having recourse to warn him verbally. For that purpose, it is more effective to use such examples as may convey the message without hurting the addressee in the least.