The soldiers were surprised by a mob; they saw their friends being lynched; they acted as any soldier would have and should have acted. To save their fellow soldiers, they opened fire. Civilians were killed. It's no cause for pride—but also nothing to be ashamed of.
Roger that, with one quibble: It is a source of shame that the IDF was surprised by a mob, and came on board unprepared for violence. (And of course its the results of the operation -- furious Turkey, empowered Iran, more blockade runners on the way, who are daring Israel to shoot them - and not the operation itself that make this such a debacle.)