This is mentioned by a couple of the commentators on the verse in Melachim 1:7:51: "When all the work that King Solomon had done in the House of the LORD was completed, Solomon brought in the sacred donations of his father David—the silver, the gold, and the vessels—and deposited them in the treasury of the House of the LORD.":
Radak wrote:
"ויבא שלמה. מה שהקדיש אביו נתן ממנו בבנין הבית לכבוד אביו כי לא היה צריך לאותו הקדש כי לרוב היה לו כסף וזהב ונחשת אך לכבוד דוד אביו נתן ממנו במלאכת בית המקדש והשאר נתן באוצרות בית ה' ופירושו ואת כל הכלים כלי זהב וכלי כסף וכלי נחשת שלקח דוד מהדרעזר ושאר הגוים כמו שכתוב למעלה, ובדרש שלא נתן שלמה מקדשי דוד אביו דבר במלאכת בית המקדש י"א לפי שידע שלמה שסופו ליחרב שלא יהיו אומרים אומות העולם מפני שהיה בנין הבית מחמס ומגזלות שגזל דוד לפיכך חרב וי"א כך אמר שלמה רעב היה בימי אבא שלש שנים שנה אחר שנה והיה לו לבזבז ההקדשות האלה להחיות בהן עניי ישראל יהיו שמורין לעת צורך"
Translation: "Solomon brought. What his father dedicated he gave from it into the the House in honor of his father, because he didn't need from that donation because of his great wealth of gold and silver and copper but in honor of his father David he gave from it to the work of the Beit Mikdash and the rest he left in the treasuries of the House of Hashem, and the meaning of "and [all of] the vessels, the gold vessels and the silver vessels and the copper vessels that David took from Hadar'ezer and all of the nations as it says above, and in the drash, that Shlomo didn't give any of what his father David dedicated to the building of the Beit Mikdash, some say this is because Shlomo knew that in the future the Mikdash would be destroyed, and so the nations wouldn't say that this happened because of the thievery and plundering of David by the sword, and some say that this is what Shlomo said: There was a famine in the time of my father for three years, year after year, and he should have spent all of these donations to feed the poor of Yisrael, so they'll be put aside for a time of need."
And Abarbanel also wrote:
"ואחרי שהשלים לספר כל המלאכה הגדולה הזאת ספר הכתוב שכל זה עשה שלמה משלו, ואולם ההקדשות אשר התנדב דוד אביו שם אותם באוצרות השם, וכאלו היה זה מכוון ממנו יתברך, כי כמו שלא רצה שדוד יבנה את הבית בימיו לפי שדמים רבים שפך, כן לא הסכים שיבנה אותו מהממון אשר אסף במלחמותיו משלל הגוים..."
Translation: "And after it finished telling of this great work, the text tells us that all of this Shlomo made from his own, while all of the things that David his father dedicated he put in the treasuries of Hashem, and this was almost as if it was directed by Him, the Blessed, for just as He didn't want that David would build the House in his days because he spilled a lot of blood, so too He didn't agree that it would be built from the wealth he collected in his wars as spoils of the nations..."