About Sayyidna Dawud (علیہ السلام) ، it was said in verse 22: فَفَزِعَ مِنْهُمْ (and he was scared of them). The reason of being scared was quite obvious. Two men barging into one's privacy in that manner at an odd hour beating the security cordon can only be because of some bad intention in most cases.
Natural fear is not contrary to the station of a prophet or man of Allah
This tells us that being naturally affected at the sight of something fearful is not contrary to the station of a prophet or man of Allah. Yes, allowing this fear to overtake one's heart and mind and abandoning duties enjoined is certainly bad. Hence, a doubt may arise here. Is it not that the Qur'an portrays the elegant status of the noble prophets by saying: لَا يَخْشَوْنَ أَحَدًا إِلَّا اللَّـهَ. (They do not fear anyone but Allah - AI-Ahzab, 33:39)? Why then, was Sayyidna Dawud (علیہ السلام) in fear on this occasion? For an answer, it could be said that there are two kinds of fear. There is the fear that comes from being hurt by what causes pain. In Arabic, this is called: خَوفُ (khauf: fear). Then there is the other kind of fear. This emerges because of someone great, majestic, awesome. This is called: خَشِیَّۃ (khashyah: awe) (al-Mufradat, Raghib al-Isfahani). There should be no khashiyah for anyone other than Allah - and noble prophets, may peace be on them all, are exactly like that. They are not awed by anyone. Yes, as said earlier, one can have a feeling of fear from naturally hurtful things.
Observe patience against contravention of established rules of etiquette until attending circumstances unfold
The statement in verse 22: قَالُوا لَا تَخَفْ (They said: "Be not scared" ) was made by the sudden entrants who said this and then started telling Sayyidna Dawud (علیہ السلام) what they wanted to while he kept listening to them silently. This tells us that, should someone commit something irregular all of a sudden, one should not start rebuking and chastising him for that on the spur of the moment, instead, one should first listen to what he has to say, so that one can find out whether or not this person had any justification for his irregular behavior. Had it been someone else, he would have unleashed his anger against such unauthorized entrants on the spot. But, Sayyidna Dawud (علیہ السلام) waited till the reality was unfolded, may be these people had some genuine excuse.
The entrant also said: وَلَا تُشْطِطْ (and do not cross the limits - 38:22). This manner of address was obviously very audacious as coming from a stranger. First of all, they came at a late hour, and that too by climbing over the wall. Then, once they were in, they started teaching a prophet as august as Sayyidna Dawud (علیہ السلام) lessons in morality by asking him to be just and not to be unjust. All this was heedless simplicity. But, Sayyidna Dawud (علیہ السلام) observed patience over whatever they did and said, and just avoided telling anything bad to them in response.