The goal is not wiping out Hamas entirely but removing their strategic capabilities within Gaza.
The IS being active in the middle east isn't a huge problem for the US but if they had a base in Cuba you'd for sure have the military there removing it asap...
How would you know who did it with such a code?
Also it only works once since you need to reveal the true code to dispute the picture