If this guy shouted at you loud enough for everyone to hear, I promise you everyone around him thought he was an absolute knob. There's nothing wrong with asking how many sets someone has left. I do it all the time and normal people (the vast majority) respond politely. I once had someone snap at me similar to what you're describing and the other people at the gym that know me were laughing at him with me afterwards. Don't worry about it.