The premise is mistaken: Europeans did colonize Egypt, in two distinct phases.
Napoleon Bonaparte invaded in 1798, aiming to disrupt British trade with India. The campaign produced the Rosetta Stone discovery and the Description de l'Égypte, but military defeat by the British and Ottomans forced French withdrawal by 1801.
After the Urabi Revolt threatened European bondholders' interests, Britain bombarded Alexandria (1882) and occupied the country. Though nominally an Ottoman province (later a British protectorate, 1914–1922), Egypt was de facto a British colony:
The 1952 Free Officers' coup (Nasser, Neguib) ended the monarchy. British troops evacuated the Canal Zone in 1954–56; the 1956 Suez Crisis sealed Egypt's full independence.
So Egypt experienced 70+ years of direct British rule and a brief French interlude — textbook colonization by any definition.