The blockade was instituted in response to the Gazans electing Hamas in free and fair, internationally monitored democratic elections, and then beginning to fire rockets at Israel, to try and reduce their ability to import weapons or components which could be used to create weapons.
There didn’t even used to be a wall. Before Hamas, you could just drive from Tel Aviv to the beaches of Gaza and back with no checkpoints.
A lot of Palestinians miss those days. I’m pretty sure most Israelis do, too.