I haven't looked at this closely, but US companies that collaborate -- even with the US military -- in a boycott of Israeli suppliers might be subject to criminal liability and penalties for violating the anti-Israel boycott legislation that Congress adopted in 1977 in response to the Arab blacklist of Israel (which to this day operates out of its Damascus headquarters).
While what you say is true, I'm not sure that it applies here. The story is that the military wasn't/isn't going to use Israeli-manufactured ammo in combat operations (or even in theater), not that it wasn't going to buy it. In fact, it seemed to indicate that the military was going to use the ammo for training purposes.
I just think that this decision is uniquely cowardly and stupid, but it don't think it illegal.