17:18-23
“The Lord was very angry”. Initially Judah was not affected, but she too followed the ways of Israel, so the Lord rejected all of Israel, and they too were “thrust from His presence. When Israel was torn away from the house of David, Jeroboam was made king, but he enticed Israel from following the Lord., and they continued along that road. The writer is making clear why Israel suffered as she did. The people of Israel went into exile in Assyria.
17:24-28
As well as dispersing Israelites, the king of Assyria brought in various people as well. This was part of the reason why Samaritans were regarded with some suspicion by the rest of Israel, they were considered to be “polluted”, and not “pure Jews”. The Assyrian king wanted the enforced “settlers” to assimilate. One could see this as a form of multiculturalism. So he sent a captured priest to teach the new settlers how to worship the Lord.
17:29-41
This experiment was not totally successful, and various groups persisted in worshipping their own gods. Children were still offered as sacrifices. So they “worshipped” the Lord, and their own gods.So they didn’t really worship the Lord. The text makes it clear that the people were not really worshipping the Lord at all, hence the antagonism towards the Samaritans.