Another interpretation: David spoke this with respect to the deed of the calf. The world was saying: "This nation, which heard from the mouth of its God (Exodus 20:3) 'You shall have no other gods before Me,' and at the end of forty days said of the calf (Exodus 32:4) 'These are your gods, O Israel' — do they have salvation?" (Psalms 3:3) "There is no salvation for him in God, Selah." "Many" can only mean the nations of the world, as it is said (Isaiah 17:12) "Woe, the multitude of many peoples." Israel said: "And You consented with them, for You said to Moses our teacher (Deuteronomy 9:14) 'Let Me alone, that I may destroy them.' But (Psalms 3:4) 'a shield about me' — for You shielded over us through the merit of our fathers, and You recalled for us the merit of Abraham, to whom You said (Genesis 15:1) 'I am a shield to you.' Before I did that deed, You did not cause Your Presence to dwell in our midst; but once I did that deed, You said (Exodus 25:8) 'And let them make Me a sanctuary,' and (Psalms 3:4) 'the One who lifts up my head.' In place of that which we were liable to You, You lifted up our heads and granted us an uplifting of the head, through Moses our teacher: (Exodus 30:12) 'When you lift up the head of the children of Israel.'"
David Answers the Nations Who Mocked Israel for the Golden Calf
Midrash Tanchuma Buber, Ki Tisa 3:2
ד"א אמר דוד כנגד מעשה העגל היה העולם אומר אומר זו ששמעה מפי אלהיה לא ייה לך (שמות כ ג), ולסוף ארבעים יום אמרו לעגל אלה אלהיך ישראל (שם לב ד), יש להם ישועה, אין ישועתה לו באלהים סלה, אין רבים אלא אומות העולם, שנאמר הוי המון עמים רבים (ישעיה יז יב), אמרו ישראל ואתה הסכמתה עמהם ואמרת למשה רבינו הרף ממני ואשמידם (דברים ט יד), אלא מגן בעדי שהגנת עלינו בזכות אבותינו, וזכרת לנו זכותו של אברהם, שאמרת לו אנכי מגן לך (בראשית טו א), עד שלא עשיתי אותו מעשה לא השרית שכינתך בקרבינו, אבל משעשיתי אותו מעשה ואמרת ועשו לי מקדש וגו' (שמות כה ח), ומרים ראשי, תחת אשר היינו חייבין לך הרמת ראשינו ונתת לנו תלוי ראש, על ידי משה רבינו כי תשא את ראש.