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.
The king of Assyria brought people from Babylon, Cuthah, Avva, Hamath, and Sepharvaim, and placed them in the cities of Samaria in place of the people of Israel; they took possession of Samaria, and settled in its cities.
When they first settled there, they did not worship the Lord; therefore the Lord sent lions among them, which killed some of them.
So the king of Assyria was told, "The nations that you have carried away and placed in the cities of Samaria do not know the law of the god of the land; therefore he has sent lions among them; they are killing them, because they do not know the law of the god of the land."
Then the king of Assyria commanded, "Send there one of the priests whom you carried away from there; let him go and live there, and teach them the law of the god of the land."
References for 2 Kings 17:27
So one of the priests whom they had carried away from Samaria came and lived in Bethel; he taught them how they should worship the Lord.
But every nation still made gods of its own and put them in the shrines of the high places that the people of Samaria had made, every nation in the cities in which they lived;
the people of Babylon made Succoth-benoth, the people of Cuth made Nergal, the people of Hamath made Ashima;
the Avvites made Nibhaz and Tartak; the Sepharvites burned their children in the fire to Adrammelech and Anammelech, the gods of Sepharvaim.
They also worshiped the Lord and appointed from among themselves all sorts of people as priests of the high places, who sacrificed for them in the shrines of the high places.
So they worshiped the Lord but also served their own gods, after the manner of the nations from among whom they had been carried away.
To this day they continue to practice their former customs. They do not worship the Lord and they do not follow the statutes or the ordinances or the law or the commandment that the Lord commanded the children of Jacob, whom he named Israel.
The Lord had made a covenant with them and commanded them, "You shall not worship other gods or bow yourselves to them or serve them or sacrifice to them,
but you shall worship the Lord, who brought you out of the land of Egypt with great power and with an outstretched arm; you shall bow yourselves to him, and to him you shall sacrifice.
The statutes and the ordinances and the law and the commandment that he wrote for you, you shall always be careful to observe. You shall not worship other gods;
you shall not forget the covenant that I have made with you. You shall not worship other gods,
but you shall worship the Lord your God; he will deliver you out of the hand of all your enemies."
They would not listen, however, but they continued to practice their former custom.
So these nations worshiped the Lord, but also served their carved images; to this day their children and their children's children continue to do as their ancestors did.