The Israelites were enmeshed in idolatry in Egypt, which is likely why they were in bondage in the first place. Ezekiel 23:2-4 shows the Israelites’ harlotry began in Egypt. They weren’t innocent slaves. One reason for the plagues on Egypt was to demonstrate God’s power over Egypt’s gods—not just to the Egyptians, but likely to the Israelites as well. Yet their idolatry was so ingrained that Ezekiel 20 indicates that they still had their idols during the Passover. Other scriptures show they carried their idols throughout the wilderness journey. The reason God did not destroy them was because He was faithful to His promises to their fathers.