גמרא נדה ע':
כתוב אחד אומר {תהלים קל"ב:י"ג} כי בחר ה' בציון וכתוב אחד אומר {ירמיהו ל"ב:ל"א} כי על אפי ועל חמתי היתה העיר הזאת למן היום אשר בנו אותה עד היום הזה כאן קודם שנשא שלמה את בת פרעה כאן לאחר שנשא שלמה את בת פרעה.
The sages of Alexandria further asked: One verse states: “For the Lord has chosen Zion; He has desired it for His dwelling place” (Tehillim 132:13), and one verse states: “For this city has been to Me a provocation of My anger and of My fury from the day that they built it until this day, so that I should remove it from before My face” (Yirmiyahu 32:31). Rabbi Yehoshua replied to them: Here, the verse in Tehillim is referring to the time before Solomon married Paroh’s daughter (see I Kings 3:1), whereas there, the verse in Yirmiyahu is speaking of the time after Solomon married Paroh’s daughter.
What was their question? If you look at the psukim in Tehillim קל"ב it is clear that the pasuk is talking about when the Jews are following the Torah.
The context in Yirmiyahu is that they are not following the Torah.