Well, those conditions were created in 2005 when Israel withdrew from Gaza and withdrew their own settlers too. Since then, Hamas were voted in (play stupid games, get stupid prizes) but at the same time, I do feel desperately sorry for the people who did this, because there was a lot of threat, intimidation, and violence to achieve that goal from Hamas.
Also, if one accepts your "prison" premise, why is there no criticism of Egypt? It's only a prison if they refuse to let people out on their side too. If Israel is to blame, then so is Egypt.