They are there even if part of Israel. If not part of Israel, they can be killed.
Periodic killing is necessary to control.
I know that terrorists infiltrate every part of Israel, but by letting the Gaza Strip go to the Palies and their election of Hamas, the terrorists then are able to build up tunnels and set up rocket launchers in order to attack Israel right at the border. According to http://en.wikipedia.org/wiki/Gaza_Strip:
The Gaza Strip forms part of the Palestinian territories. Since July 2007, following the 2006 Palestinian legislative election and the following the Battle of Gaza, Hamas has functioned as the de facto ruler in the Gaza Strip, forming an alternative Hamas Government in Gaza.
And for the Oslo Accords that essentially made Israel give up their strategic southwestern flank, we can thank: