This isn't being sold to an American enemy - in fact, the US sells and donates (!) weapons to the same government. The US doesn't care much about Israel (a Major Non-NATO Ally) or Turkey (a NATO member) selling artillery pieces and APCs to Uganda.
It's all about the specific class of weapon. There are general understandings about who can get sold what weapon without the US getting mad. No radars or surface-to-air missiles for China or Russia or for random tiny dictatorships; but it's totally okay to sell them to India or Latin America. Dumber things like artillery pieces can go anywhere, even places under US sanctions like Myanmar, without crossing any lines. But this isn't written in treaties; it's all implicit understandings and learned patterns of retaliation.
For this new class of weapon, both sides are still feeling out the rules. The US is laying down precedents that put NSO's products much closer to the rules for radars and missiles, while Israel is pushing the limits to see how far the US can live with.