Egypt has locked down the Gaza border since 2007, why?

I just read that, wazn’t the Muslim Brotherhopd in power at some point between then and now, a Hamas friendly government. I’ve also read that there is Palestinian terrorist attacks in the Egyptian northern Sinai.

I would have thought Egypt would be a little sympathetic