To be fair, part of the peace deal between Egypt and Israel gave Israel some control over the crossing, and they seized it entirely during the war.
https://en.wikipedia.org/wiki/Rafah_Border_Crossing
> The Rafah crossing was opened by Israel after the 1979 peace treaty and remained under Israeli control until 2005...
> Under a 2007 agreement between Egypt and Israel, Egypt controls the crossing but imports through the Rafah crossing require Israeli approval.
This is to a large part to give Egypt plausible deniability. They don’t want to deal with Gaza, refugees, or a humanitarian crisis, but also don’t want the political fallout of taking action like the Israelis do.