Embarrasing Behavior

I Samuel 21:13,14
‘So he disguised his sanity while in their sight and acted insanely in their custody, and he scribbled on the doors of the gate, and drooled on his beard. Then Achish said to his servants, “Look, you see the man is behaving like an insane person. Why do you bring him to me?”‘

I'm not sure how to comment on this. Is this a brilliant diversion to save himself, or is it a lack of faith? After reading many commentaries, only one criticizes him. Two Psalms are supposed to be describing this incident, Psalm 34 and 56. The latter describes it as an arrest. Both Psalms have David praising God for his deliverance.
Abraham and Isaac lied to foreign kings to have their lives spared. Both include the Lord's disapproval. There is none of that here. Simply the description, the positive outcome and the Psalms with David's delight in being spared. David is open with his life before God. There doesn't seem to be any disapproval or regret. 
This is the first description of David being afraid in scripture. The Lord allowed him to go through difficulties. The lion and the bear were there to prepare him for Goliath. He had an enemy in king Saul. He was a powerful foe that kept David on the run for many years. That forced him to leave the country. He is in the land of the Philistines. He gets caught and is brought before Achish. He is in a fearful situation. 
David does what comes to mind and puts on an act that he's lost his mind. It works as the king dismisses David as being undesirable. This isn't very dignified and some may criticize it. David had an example of someone mentally unstable in King Saul. 
I would say we need to be understanding, as we will be exposed to terrifying situations. The scripture doesn't judge him, so we shouldn't either. I Peter 3:7 says, "You husbands in the same way, live with your wives in an understanding way, as with someone weaker, since she is a woman; and show her honor as a fellow heir of the grace of life, so that your prayers will not be hindered." We are told to be understanding. The end of the verse tells us that our prayers could be hindered, if we aren't. 
We will have tough times and our behavior might not be something to be proud of. Hopefully it won't be sinful. We trust that the Lord will help us to stand. We are also to be understanding of others.
Lord, thank You that You include all aspects of the people in the bible. It takes the pressure off. Help us to stay true to You and Your Word.