Gaza is controlled entirely by Hamas.
In August 2005, Israel withdrew approximately 8,000 settlers from Gaza, and relinquished all control of the territory to the Palestinian Authority (PA). In 2007, a Hamas-led coup ousted the PA from Gaza. Hamas has been in control of Gaza ever since.
Since 2007, Hamas has used Gaza as a launching pad for attacks against Israel. Israel, and Egypt, have thus taken steps to ensure that the Palestinians do not import weapons. They do so by patrolling Gaza’s land and water borders.
Israel has a sophisticated border fence to prevent Palestinian terrorists from entering Israeli sovereign territory from Gaza. It is essentially a border. It is designed to keep Palestinians out of Israel, not keep them locked in Gaza.
Egypt shares a border with Gaza as well. They similarly exercise their sovereignty by controlling the border between Egypt and Gaza, determining who can enter Egyptian sovereign territory.
Egypt, or any other Arab country for that matter, could take Palestinians from Gaza, but has refused to do so, citing security concerns.
In the last 16 years, Hamas has received millions of dollars in aid from international sources, so that they can build a viable infrastructure, health-care systems, sewers, water supplies, an electricity grid, etc. Instead, Hamas leaders have taken the money, and live outside of Gaza, in places like Qatar. They have also used those funds to build a terrorist infrastructure in Gaza, turning water-pipes into rockets, and using concrete intended for buildings for terror-tunnels instead.
Gaza is not an open-air prison: it is a territory run by a terrorist entity that cares less about the Palestinians, and more about the destruction of Israel.