Here is some background to the inscriptions of Psalms 34, Of David, when he feigned his madness in the face of Abimelek and he expelled him and he walked away, and Psalm 52:1-2 (the germ for this psalm is approached here and more fully developed in 1 Samuel 22).
Note that the versification in the Hebrew differs by 1 with the English since verse 1 below is in the prior chapter in the English version. In the prior chapter, Saul is furious with his son Jonathon whom he perceives has fallen in love with David and effectively ceded the throne to him. (I will eventually come back to that chapter. I haven't really wrestled with it yet.)
In verse 3, one has to be creative with פְּלֹנִ֖י אַלְמוֹנִֽי - it sort of means phoney baloney, or some such phrase. David's whole speech is, This is something I will say words about and you will be impressed but they don't mean anything and you won't find out till it is too late for you.
The play on impurity (vv 5-7) is curious. The word כלי can be glossed as equipment (such as a sword v 9), or inner pouch (compare 1 Samuel 17 and where David kept his stones), or it may be a vessel or a pot or a person's 'vital centre' (Psalms 7:10, 16:7, 26:2). This last never fails to remind me of the British Stage where on our first visit to England in 1978 we heard the memorable phrase "Stop me vitals!" in a restoration comedy.
Clearly in this chapter it refers first to the men's sexual continence over the past few days since Ahimelech was being forced into giving up the bread of the presence. Now that should put the humour of Jesus comment (Matthew 12:4-5) on this section into a different light for you. He seems to commend David's boisterous and deceptive behaviour. Three days is long enough of course. One hopes but doubts that the men had bathed.
וִיהוֹנָתָ֖ן בָּ֥א הָעִֽיר
|1||And he arose and he walked away|
while Jonathan went to the city.
|וַיָּבֹ֤א דָוִד֙ נֹ֔בֶה אֶל אֲחִימֶ֖לֶךְ הַכֹּהֵ֑ן|
וַיֶּחֱרַ֨ד אֲחִימֶ֜לֶךְ לִקְרַ֣את דָּוִ֗ד וַיֹּ֤אמֶר לוֹ֙ מַדּ֤וּעַ אַתָּה֙ לְבַדֶּ֔ךָ וְאִ֖ישׁ אֵ֥ין אִתָּֽךְ
|2||And David went towards Nob to Ahimelech the priest.|
And Ahimelek was apprehensive about encountering David and he said to him, for what purpose are you on your own and there is no one else with you?
|וַיֹּ֨אמֶר דָּוִ֜ד לַאֲחִימֶ֣לֶךְ הַכֹּהֵ֗ן הַמֶּלֶךְ֮ צִוַּ֣נִי דָבָר֒ וַיֹּ֣אמֶר אֵלַ֗י אִ֣ישׁ אַל יֵ֧דַע מְא֛וּמָה אֶת הַדָּבָ֛ר אֲשֶׁר אָנֹכִ֥י שֹׁלֵֽחֲךָ֖ וַאֲשֶׁ֣ר צִוִּיתִ֑ךָ|
וְאֶת הַנְּעָרִ֣ים יוֹדַ֔עְתִּי אֶל מְק֥וֹם פְּלֹנִ֖י אַלְמוֹנִֽי
|3||And David said to Ahimelech the priest, The king has commanded me something and said to me, Let no one else know anything whatever of the matter that I myself have sent you on nor what I have commanded you.|
And as for the lads, I have made known an appropriate suitable assignation.
|וְעַתָּ֗ה מַה יֵּ֧שׁ תַּֽחַת יָדְךָ֛ חֲמִשָּׁה לֶ֖חֶם תְּנָ֣ה בְיָדִ֑י|
|4||And now, what is there under your hand? Those five loaves of bread, Give them here in my hand|
or whatever is found.
|וַיַּ֨עַן הַכֹּהֵ֤ן אֶת דָּוִד֙ וַיֹּ֔אמֶר אֵֽין לֶ֥חֶם חֹ֖ל אֶל תַּ֣חַת יָדִ֑י|
כִּֽי אִם לֶ֤חֶם קֹ֙דֶשׁ֙ יֵ֔שׁ אִם נִשְׁמְר֥וּ הַנְּעָרִ֖ים אַ֥ךְ מֵאִשָּֽׁה
|5||And the priest answered David and he said, There is no profane bread under my hand, but only holy bread there is, if the lads have refrained surely from women.||21|
|וַיַּעַן֩ דָּוִ֨ד אֶת הַכֹּהֵ֜ן וַיֹּ֣אמֶר ל֗וֹ כִּ֣י אִם אִשָּׁ֤ה עֲצֻֽרָה לָ֙נוּ֙ כִּתְמ֣וֹל שִׁלְשֹׁ֔ם בְּצֵאתִ֕י וַיִּהְי֥וּ כְלֵֽי הַנְּעָרִ֖ים קֹ֑דֶשׁ|
וְהוּא֙ דֶּ֣רֶךְ חֹ֔ל וְאַ֕ף כִּ֥י הַיּ֖וֹם יִקְדַּ֥שׁ בַּכֶּֽלִי
|6||And David answered the priest and he said to him, but only? Women have been withheld from us from yesterday, three days since I came out, so the equipment of the lads is holy.|
And this, in a way, is profane, and also for today, is holy, in my equipment.
|וַיִּתֶּן ל֥וֹ הַכֹּהֵ֖ן קֹ֑דֶשׁ|
כִּי֩ לֹא הָ֨יָה שָׁ֜ם לֶ֗חֶם כִּֽי אִם לֶ֤חֶם הַפָּנִים֙ הַמּֽוּסָרִים֙ מִלִּפְנֵ֣י יְהוָ֔ה לָשׂוּם֙ לֶ֣חֶם חֹ֔ם בְּי֖וֹם הִלָּקְחֽוֹ
|7||And so the priest gave him the holy.|
For there was no bread there but only the bread of the presence put aside from the presence of Yahweh, set in place as warm bread in the day when it was taken.
|וְשָׁ֡ם אִישׁ֩ מֵעַבְדֵ֨י שָׁא֜וּל בַּיּ֣וֹם הַה֗וּא נֶעְצָר֙ לִפְנֵ֣י יְהוָ֔ה וּשְׁמ֖וֹ דֹּאֵ֣ג הָאֲדֹמִ֑י|
אַבִּ֥יר הָרֹעִ֖ים אֲשֶׁ֥ר לְשָׁאֽוּל
|8||And there was someone of Saul's servants in that day detained in the presence of Yahweh whose name was Doeg the Edomite,|
one mighty of the shepherds that belonged to Saul.
|וַיֹּ֤אמֶר דָּוִד֙ לַאֲחִימֶ֔לֶךְ וְאִ֛ין יֶשׁ פֹּ֥ה תַֽחַת יָדְךָ֖ חֲנִ֣ית אוֹ חָ֑רֶב|
כִּ֣י גַם חַרְבִּ֤י וְגַם כֵּלַי֙ לֹֽא לָקַ֣חְתִּי בְיָדִ֔י כִּֽי הָיָ֥ה דְבַר הַמֶּ֖לֶךְ נָחֽוּץ
|9||And David said to Ahimelech, Is there not here under your hand a spear or a sword?|
For even my sword and even my equipment I did not take in my hand, for the king's matter was pressing.
|וַיֹּ֣אמֶר הַכֹּהֵ֗ן חֶרֶב֩ גָּלְיָ֨ת הַפְּלִשְׁתִּ֜י אֲשֶׁר הִכִּ֣יתָ בְּעֵ֣מֶק הָאֵלָ֗ה הִנֵּה הִ֞יא לוּטָ֣ה בַשִּׂמְלָה֮ אַחֲרֵ֣י הָאֵפוֹד֒ אִם אֹתָ֤הּ תִּֽקַּח לְךָ֙ קָ֔ח כִּ֣י אֵ֥ין אַחֶ֛רֶת זוּלָתָ֖הּ בָּזֶ֑ה|
וַיֹּ֧אמֶר דָּוִ֛ד אֵ֥ין כָּמ֖וֹהָ תְּנֶ֥נָּה לִּֽי
|10||And the priest said, The sword of Goliath the Philistine whom you struck in the valley of Eilah, behold her bound up in a shawl behind the ephod. If you, you take for yourself, take her, for there is no other in this except this one.|
And David said, There is none like her. Give her to me.
|וַיָּ֣קָם דָּוִ֔ד וַיִּבְרַ֥ח בַּיּוֹם הַה֖וּא מִפְּנֵ֣י שָׁא֑וּל|
וַיָּבֹ֕א אֶל אָכִ֖ישׁ מֶ֥לֶךְ גַּֽת
|11||And David arose and he ran away on that day from the presence of Saul.|
And he came to Akish, king of Gath.
|וַיֹּ֨אמְר֜וּ עַבְדֵ֤י אָכִישׁ֙ אֵלָ֔יו הֲלוֹא זֶ֥ה דָוִ֖ד מֶ֣לֶךְ הָאָ֑רֶץ|
הֲל֣וֹא לָזֶ֗ה יַעֲנ֤וּ בַמְּחֹלוֹת֙ לֵאמֹ֔ר הִכָּ֤ה שָׁאוּל֙ באלפו בַּאֲלָפָ֔יו וְדָוִ֖ד ברבבתו בְּרִבְבֹתָֽיו
|12||And the servants of Akish said to him, Is this not David, the king of the land?|
Did not this one answer in the dance saying Saul struck his thousands, but David his tens of thousands.
|וַיָּ֧שֶׂם דָּוִ֛ד אֶת הַדְּבָרִ֥ים הָאֵ֖לֶּה בִּלְבָב֑וֹ|
וַיִּרָ֣א מְאֹ֔ד מִפְּנֵ֖י אָכִ֥ישׁ מֶֽלֶךְ גַּֽת
|13||And David laid up these words in his heart,|
and he feared much from the presence of Akish, king of Gath.
|וַיְשַׁנּ֤וֹ אֶת טַעְמוֹ֙ בְּעֵ֣ינֵיהֶ֔ם וַיִּתְהֹלֵ֖ל בְּיָדָ֑ם|
וַיְתָיו֙ עַל דַּלְת֣וֹת הַשַּׁ֔עַר וַיּ֥וֹרֶד רִיר֖וֹ אֶל זְקָנֽוֹ
|14||So he feigned his madness in their eyes and he played the fool in their hands,|
and he scratched graffiti upon the portals of the gate and let his spittle run down to his beard.
|וַיֹּ֥אמֶר אָכִ֖ישׁ אֶל עֲבָדָ֑יו|
הִנֵּ֤ה תִרְאוּ֙ אִ֣ישׁ מִשְׁתַּגֵּ֔עַ לָ֛מָּה תָּבִ֥יאוּ אֹת֖וֹ אֵלָֽי
|15||And Akish said to his servants, Behold you see a person who is crazy. Why did you have him come to me?||9|
|חֲסַ֤ר מְשֻׁגָּעִים֙ אָ֔נִי כִּי הֲבֵאתֶ֣ם אֶת זֶ֔ה לְהִשְׁתַּגֵּ֖עַ עָלָ֑י|
הֲזֶ֖ה יָב֥וֹא אֶל בֵּיתִֽי
|16||Have I lack of crazies that you have brought this to be crazy before me?|
Will this one come to my house?