In the accidental tragic killing of the 67 year old man in the West Bank, the IDF were raiding a Hamas cell. That raid was legitimate business.
In the other incident, the Jewish student had every right to keep an Israeli flag between his bed and the wall. What the offender did was no accident. Inebriation is no excuse.
In western legal systems, intent is 90% of the law.