These scriptures are prophetic and appear to be coming into view. It's best to consider the entire chapter concerning Egypt.
The evil spirit referenced is the spiritual cancer known as Islam. Fortunately, Egypt is saved out of Islam and worships the LORD. Clearly signifying the end of Islam.
Egypt was greatly used by God and will be again, as the prophecy prescribes. The Patriarchs found refuge in Egypt. Joseph prospered in Egypt and married a daughter of an Egyptian priest, she bare him Ephraim and Manasseh. Even the Lord Jesus Christ found refuge in Egypt until the first Herod was dead.
Whilst Egypt is still currently Islamic, it has stopped attacking Israel and has been in a lukewarm peace with Israel for several decades.
IMO, the key to everything falling into place is the prophesied Ezekiel chapters 38 and 39 Gog-Magog Alliance of nations war. I believe that war will be the death of Islam as most of the nations in that Alliance are Islamic and they will come forth in the confidence and name of their false god Allah. This Alliance is already aligned and chomping at the bit to attempt to devour Israel.
Finally, and also falling into place, is the isolation of, and aggression towards, the Kurds by the rest of the Islamic nations that surround them. The Kurds have been friendly with, and useful to the United States, and have not been antagonist towards Israel like the nations that surround them. The Kurds live in the territory of the old Assyrian Empire. Israel and the Kurds are both isolated and hated by the Gog-Magog Alliance of nations, which makes them potential allies.
Once the Lord slaughters the Gog-Magog Alliance of nations, and Islam is neutered, the Jews will be able to build the Third Temple upon the Temple Mount. It will not happen until Islam is neutered, and the Gog-Magog Alliance of nations war will accomplish that.
The beautiful thing is it is staged and could happen very soon.