Linguist here! Your question is a pretty interesting one that historical linguists have been debating for years. Really, the problem goes beyond just Egyptian, as there are a large number of languages that once held positions of prestige and influence in world history that now are either dead or in severe decline. For instance, Sumerian was the first written language, but it was largely supplanted by Akkadian, an unrelated language that borrowed the Sumerian writing system. Akkadian in turn was overtaken by its sister Aramaic. Both Aramaic and Egyptian/Coptic were then replaced by the spread of Arabic and Islam in the 7th century.
So the question becomes, why would these languages that were already in positions of prestige and influence succumb to the advances comparatively less important or historically significant languages? The short answer from historical linguistics is that we don't know. We can point to events after the fact that seem likely contributors, but there don't seem to be consistent patterns that let us go much beyond individual cases. In the case of Egyptian, certainly the spread of Islam and Arabic was the root cause of its decline, but it doesn't really explain why Arabic came out the victor. There are numerous examples in history of conquerors adopting the language of the people that they conquered. Remember the switch from Akkadian to Aramaic from before? The Akkadian-speaking Assyrians conquered the Aramaic-speaking people and slowly adopted the language of the people they had conquered. Every foreign invader of China wound up adopting Chinese rather than forcing Mongolian or Manchurian on any portion of Chinese society. So we can reasonably wonder why the Arabic conquerors of Egypt didn't adopt Egyptian/Coptic themselves.
When we look at other languages in similar positions to Egyptian, we can formulate some hypotheses, but really just that. As I mentioned, Aramaic also was largely erased by the spread of Arabic and Islam, with now just a few thousand speakers worldwide. But at the same time, Persian/Farsi, which like Egyptian had a long history and cultural significance, remains the dominant language in Iran today, despite its own adoption of Islam. One factor here may be that Egyptian and Aramaic belong to the same general language family as Arabic, perhaps allowing easier conversion between them. But again, we find many examples in history that can contradict this pattern. As noted above, Akkadian replaced the completely unrelated Sumerian, suggesting that the same fate could have happened to Persian/Farsi. And it still fails to explain why the Arabic conquerors didn't wind up speaking Aramaic and Egyptian themselves, since the switch would have been just as easy for them as for the people that they conquered.
In summary, we can often point to events and historical trends that seem significant for the rise and decline of specific world languages, but when we look for trends or patterns that might help us predict or explain the overall process, we're left with very little to go off of. What language you speak appear to be a very complex interaction of culture, history, economics, politics, and numerous other factors which seem to defy easy generalization.
Much of what I've shared here comes from Nicholas Ostler's excellent book Empires of the Word, which details a number of these historical language shifts and tries to make some sense out of them.
TLDR; we don't know the general reasons for language decline overall, but the decline of Egyptian/Coptic is pretty definitely linked to the spread of Arabic and Islam from the 7th century on.
You may want to x-post this into /r/asklinguistics.
You may be interested in this thread from a few months ago. The descendants of the ancient Egyptian language were still in use just a handful of centuries ago, and the language does survive, as needless_pickup_line said, in Egyptian Coptic traditions.
Keep in mind that there was a long period of time where Egypt wasn't it's own polity. It was conquered three times by Persians, ruled by four different Arab dynasties, and been a part of the Roman/Byzantine, Hellenistic, and Ottoman Empires. This accounts for most of the years between the 6th century BC and the 19th century AD. Each of these introduced their own languages alongside their political control. So while the people may have been speaking Egyptian, those in charge were quite often not actually Egyptian themselves.