I would leave with my friend. I wouldn't be able to have a good time knowing my friend was being left out. If I was the person out of dress code I would like it if my friends didn't leave me out, but I would also feel pretty bad for being the reason they would even consider not going into the club.
that happened to me once. but for a different reason. (I forgot to bring my ID)
if it were my friend who is denied entry into the club, I'd leave with him/her. if it were me, I'd tell my friends to go ahead and I'd hop on a cab home. I wouldn't want to stop them from having fun just because of something I did. overactive guilt complex doesn't work too well in a situation like this...
Id leave with the friend that couldn't get in. I would never leave that friend hanging. If I was the one who coouldnt get in first Id feel like an idiot because that issue should of been checked into before we even got into the club. But id try to get a ride from another friend or maybe go to a bar that has no dress code and hang out while the friends got to go into the club for awhile so they could have fun and experience it.
I only have one friend so leaving would be my only option. Plus you should stick by your friends.