Because if you hit a rocket launcher located 10 feet away from a building or on a roof of a building then a good portion of the building will be damaged. This should be obvious.
So seconds after the rocket is launched you are claiming the launcher is moved? These are sizeable rockets and the launchers are sizeable. They are not easy to disassemble and move quickly. Many were left in place for weeks -- merely covered and uncovered in camouflage attempts between launches.
Yes, airstrikes are generally done when the launch site is identified via the launch of the rocket. Seconds later the launcher is scrap metal and anything near it is destroyed as well. This ensures you are hitting an active launcher and not a decoy.
How long does it take to program the coordinates into the missile or JDAMs? How long to scramble the plane and get it into position? How long to get the coordinate information from the missile detection system to the plane? More than a few seconds.
First, it should be noted that Israeli military planes are in a constant pattern over Gaza -- just waiting for an appropriate target. Two options - if using visual just place the aiming dot on the active launch site and manually press the trigger. Or more likely at this point it is completely automated -- the technology detects the launch and the missile from the jet to eliminate the rocket launcher is in the air seconds later. Exclusion areas such as hospitals and land outside Gaza is probably pre-programmed before the plane takes off.