You have forgotten Me and turned your back on Me, so You will be punished for your sinning and prostitution...
In Ezekiel 23, the prophet condemns the immorality of both Samaria of Northern Israel (23:4,5-10) and Jerusalem of Judah (23:4,11-21). In summarizing the history of these Israelite cities, God likens them to two sisters who became harlots at a young age (23:3,19) and continued their practice to an old age (23:43). Instead of being faithful to God, they constantly turned their affections to nations like Egypt (23:3) and embraced all of their idols and false worship.
The people of Samaria also became infatuated with the might and religion of Assyria (23:5-7), and incorporated its immorality into their lives. Meanwhile they never gave up their lust for Egypt (23:8).
God would punish Samaria by delivering her "into the hands of the Assyrians, for whom she lusted" (23:9-10). In other words, God allowed this foreign nation, with whom she was fascinated, to execute judgment upon her for her sin.
At the time Ezekiel spoke these words, the nation of Samaria had already been punished for its sin and destroyed by the Assyrians. The prophet speaks of this as an example lesson to the Israelites in Jerusalem. He then declared that Jerusalem herself had become defiled by a lust for the sin of Egypt (23:19-21), Assyria (23:12) and Babylon (23:14-18). She not only followed in "the same way" of unfaithfulness as her sister Samaria (23:13), she became more corrupt (23:11). Thus God would likewise punish her (23:22-35). As God sent the Assyrians to destroy Samaria in 721 B.C., He sent the Babylonians to level Jerusalem in 586 B.C.
The great lesson of Ezekiel 23 is that we must learn from the mistakes of others. The Israelites in Judah and Jerusalem should have learned from the errors of their brethren in Samaria. Sin and idolatry brought the wrath of God upon Samaria to its extinction as a nation. Why didn't the people of Jerusalem reason that if they did the same things, that they would receive the same punishment? Failure to do so cost them their city, their temple, their lives and their souls.
The Bible abounds in examples of ungodly people being punished -- even those who were once faithful to Him. Let's take warning from these passages and not become infatuated with the sin of this world. Instead, let's serve the God of Heaven with diligence