The Deuteronomic History consists of Joshua, Judges, 1 Samuel, 2 Samuel, 1 Kings and 2 Kings. The Deuteronomist wrote during the reign of King Josiah, some decades before the Babylonian destruction of Jerusalem, but another scribe has completed the Book of 2 Kings up to the time of the Babylonian Exile.
2 Kings 23:37 says that did that which was evil in the sight of the Lord. More importantly, 2 Kings 24:1-4 says that Nebuchadnezzar attacked Jerusalem because of the sins of King Manasseh about a century earlier. In its coverage of Manasseh, 2 Kings had been particularly scathing of Manasseh for engaging in child sacrifice in response to the dangers faced by Jerusalem at that time.