How do you know his actions didn't affect her?
Last we see of Gamora is during the battle where she has a little spat with Quill, after that we don't see her. For all we know she does actually survive the battle and Tony's snap.
Tony might have excluded her anyway
Gamora was seen fighting for the good guys on the field in the battle and Tony at least knows her name because Quill mentioned her multiple times in front of him. It stands to reason that in the off screen time on Titan in Avengers: Infinity War he may have described her more to see if they had seen her. As such he may have excluded her.
Tony might not have seen her
And if the previous point doesn't float your boat Tony might not have seen her in the battle anyway and as such might have excluded her on the grounds of not knowing she was there to be snapped.
The Stones may have decided
As Paul D. Waite mentions in a comment Tony may have just decided to wipe out Thanos' forces and the Stones/Gauntlet themselves may have decided what constitutes someone working for Thanos. As Gamora had switched sides at this point it may have left her alone.