Gaza was an open air prison that was used as a shooting range for the IDF to practice cruelty and train in a murderous intent into their soldiers. It would teach the government as well what soldiers they could rely on and social force others to step in line. Unfortunately they were just to good at it and there are still more young people to teach to hate, so they moved.
Its the same reason they won't leave Lebanon now either. They need a new place for target practice and they will have to keep moving as they decimate the last place they use.