Egypt spends 1.2% of GDP on defense. That is not all that much.
Egypt has 100M inhabitants making it one of the biggest countries in the Middle East, so in absolute terms its spending will look big compared to its just-as-poor neighbors.
Egypt runs a conscription army with about 440k military. Each soldier is going to cost a fixed minimum amount.
Egypt is facing some level of Islamist insurgency nowadays, though much of the military budget predates that. Countering insurgencies can be either considered a police/intelligence matter or a military matter and if it's the latter, you need the defense budget to match. Note that spending on paramilitaries is a bit of a gray area wrt Egypt.
Last, but not least, Egypt is under a military government. Toys for the boys is a common refrain under military governments in poor countries. A number of South American countries have historically had fairly big militaries compared to the credible regional threats they were facing.