This happened because the Israelites had sinned against Yahweh their God, who had brought them up out of the land of Egypt, from under the hand of Pharaoh king of Egypt, and they had feared other gods.
In context
5The king of Assyria invaded the whole land, marched against Samaria, and besieged it for three years. 6In the ninth year of Hoshea, the king of Assyria captured Samaria and deported Israel to Assyria; he settled them in Halah, in Gozan on the Habor River, and in the towns of the Medes. 7This happened because the Israelites had sinned against Yahweh their God, who had brought them up out of the land of Egypt, from under the hand of Pharaoh king of Egypt, and they had feared other gods. 8They followed the customs of the nations Yahweh had driven out before the Israelites, and the customs the kings of Israel had introduced. 9The Israelites secretly did things against Yahweh their God that were not right; they built high places for themselves in all their towns, from the watchtower to the fortified city.