What sparked-off Moshe?s anger?
Why was Moshe angry specifically with the officers?
Rashi: Because the sins of the generation are attributed to their leaders who have the power to stop them. 1
See Torah Temimah, note 16.
Why was Moshe not angry with Pinchas?
Oznayim la'Torah #1: Because Pichas' role was that of Mashu'ach Milchamah which was confined to encouraging the troops to fight, but not to matters of strategy, which was in the hands of the officers.
Oznayim la'Torah #2: Because the way of the Torah is to rebuke the junior sinner, and the senior sinner will get the message automatically. 1
Oznayim la'Torah: Like we find when Hashem scolded Sarah for laughing, even though Avraham laughed too, and when Moshe was angry with Elazar and Isamar, even though Aharon was guiltu of the same sin (which Moshe acuused them of).