Is it rude for a guy to talk to a girl and ask for her number if she is out with a guy already?

So today I went to the club with some friends and as I was leaving I saw this girl and started talking to her. We seemed to hit it off a bit so I asked for her Instagram and she gave it to me and seemed enthusiastic about the whole encounter but the guy she was with was not happy at all and made a bit of a deal of the whole situation. Later one on of my male friends said that I was being disrespectful by doing all of that but I’m not sure if I agree with it. What everyone’s opinion on this?
Is it rude for a guy to talk to a girl and ask for her number if she is out with a guy already?
Post Opinion