When the US was in Afghanistan, Al Qaeda learned that the US (generally) won't shoot ambulances. So what became the most valuable vehicle to Al Qaeda? Hamas took notes, but Israel doesn't seem to care as much as the US.
Also, besides all that, once something is used for military operations, it is fair game as a military target. Regardless of civilians. When the law was written it was assumed that governments wouldn't intentionally use their civilians as protection.