Well - there are three main ways to extract income from almost any part of the world; trade, taxation, and production.
Trade. Egypt was an incredibly nice region for trade because it was an easy route for goods like spices and ivory from India, Indochina, eastern Africa, etc. to find their way to the wealthy merchant markets of Europe which desired said goods. Control of Egypt (and to a near-equal extent the Levant to its north) gave the Romans, Ottomans, Mamluks, and other states an element of control over this trade.
Taxation. It doesn't look like much from space, but the Nile Valley/Delta is still one of the most fertile regions in the world - doubly so before the modern era. There was more than enough grain to supply a massive population which continued to grow. The population of Egypt was very dense, and all of these individuals could be taxed to collect money for the state.
Production. Egypt produced so much grain that large amounts of it was exported to both other parts of the empire and other parts of the world. Egypt also produced massive quantities of paper, which was considered luxurious for much of the early modern period. Additionally, the dense population of Egypt allowed for artisans to spring up whose crafts were often sold as trinkets in European markets.
I'd like to ask a small related question of my own here.
Given that Egypt was so spectacularly fertile as a result if annual flooding, why build the Aswan Dam? Is the dam a direct contributor to Egypt's switch from food exporter to importer?
As has already been pointed out, Egypt was an extremely important area for farming. The Nile River and it's annual flooding provided extremely fertile farmland, making the region a fantastic breadbasket for whatever empire or power controlled it. Egypt at one point was the primary grain supplier of Rome, which made it desperately important to control during the Year of the Four Emperors. Vespasian was able to put pressure on his rival Vitellius by taking Egypt.
It also was a huge grain supply region for Istanbul and the Ottoman Empire during the late 1700s, part of the reason for the Ottoman entrance into the Second Coalition against France when Napoleon invaded the country.
Beyond just the farming and food aspect, Egypt also gave a lot of prestige. As an ancient power that had been respected by Greeks, Romans, and many other civilizations, Egypt commanded a certain respect and influence through the sheer age and poise of their traditions and culture.