The president called Israel’s attack, which flattened a residential city block, “a measure of justice.”