The term "yanqui" has been used for a long time by communists in a very negative way, that is why. But those who are not in the know, would most likely use it. Your wife and your family are avoiding it for sure.
You've just experienced a little power tripping which some officials get off on. They just want to see you sweat making you think you'll miss your flight. Best to remain cool and calm in these circumstances.
Gabacho is probably more common than gringo nowadays with Mexicans. Chileans do like to use gringo though.
I am an American (norteamericana) married to an Argentino and I am commonly called gringa. At first I was offended, but it was carefully and repeatedly explained to me that this is just a descriptive word for a foreigner from Europe or North America and not intended as an insult. After all, the Argentinos call each other Gordo, Flaco, Viejo, Negro, etc. In the family, I am affectionately La Tia Gringa, but it is not just family. On our block in Balvanera, when I am not around the local merchants routinely ask my husband "Donde esta la gringa?"
After waiting in line and passing security like everyone else, I flashed my passport to the customs official when it's my turn. A guy in a suit comes over, takes me out of the line, and makes me stand in a corner. I asked why. He says "Argentinians only!" very rudely and says "Brazilians here." I say I'm a gringo and he just ignores me. After another twenty minutes of standing in a corner alone, he directs me to a specific booth where the woman grills me on my entry and exit dates. She can't read the stamps correctly so I have to walk her through my entries and exists in EZE. Then she asks what my business is here, why so many exits and entries and I explain. She then randomly asks if my wife is Argentinian or "Mexican" which dumbfounded me. Like why is that relevant, and why Mexican of all nationalities (I do not have a Mexican accent or any native Spanish accent when speaking).
Never had so many problems trying to *leave* Argentina.