This occurred because the people of Israel had sinned against the Lord their God, who had brought them up out of the land of Egypt from under the hand of Pharaoh king of Egypt. They had worshiped other gods
and walked in the customs of the nations whom the Lord drove out before the people of Israel, and in the customs that the kings of Israel had introduced.
References for 2 Kings 17:8
The people of Israel secretly did things that were not right against the Lord their God. They built for themselves high places at all their towns, from watchtower to fortified city;
they set up for themselves pillars and sacred poles on every high hill and under every green tree;
References for 2 Kings 17:10
there they made offerings on all the high places, as the nations did whom the Lord carried away before them. They did wicked things, provoking the Lord to anger;
they served idols, of which the Lord had said to them, "You shall not do this."
Yet the Lord warned Israel and Judah by every prophet and every seer, saying, "Turn from your evil ways and keep my commandments and my statutes, in accordance with all the law that I commanded your ancestors and that I sent to you by my servants the prophets."
They would not listen but were stubborn, as their ancestors had been, who did not believe in the Lord their God.
They despised his statutes, and his covenant that he made with their ancestors, and the warnings that he gave them. They went after false idols and became false; they followed the nations that were around them, concerning whom the Lord had commanded them that they should not do as they did.
They rejected all the commandments of the Lord their God and made for themselves cast images of two calves; they made a sacred pole, worshiped all the host of heaven, and served Baal.
References for 2 Kings 17:16
They made their sons and their daughters pass through fire; they used divination and augury; and they sold themselves to do evil in the sight of the Lord, provoking him to anger.
Therefore the Lord was very angry with Israel and removed them out of his sight; none was left but the tribe of Judah alone.
Judah also did not keep the commandments of the Lord their God but walked in the customs that Israel had introduced.
The Lord rejected all the descendants of Israel; he punished them and gave them into the hand of plunderers, until he had banished them from his presence.
When he had torn Israel from the house of David, they made Jeroboam son of Nebat king. Jeroboam drove Israel from following the Lord and made them commit great sin.
The people of Israel continued in all the sins that Jeroboam committed; they did not depart from them
until the Lord removed Israel out of his sight, as he had foretold through all his servants the prophets. So Israel was exiled from their own land to Assyria until this day.