Of course people in Gaza are already heavily dependent on Egypt for supplies and the people of Gaza would have to support such a legal binding agreement to join Egypt or not. As far as Gaza being economically inferior, well some parts of Egypt are just as economically impoverished as Gaza, but Egypt can surely invest in Gaza it has already been supplying Gaza with aid for years.
The fact is Hamas cannot effectively govern Gaza, the only solution I think is for the foreseeable future is Egypt annex Gaza, Egypt govern Gaza, provide security, disband Hamas, etc. Egypt would also gain extra shoreline in the Mediterranean and could build a military outpost in Gaza, there are benefits as well not just all despair. Most importantly it could help get Gaza under control and no more fear of Israeli retaliation in Gaza, as Egypt will crack down on Gaza and secure the place, because if someone doesn't Israel will.