Sounds like he said that to be sarcastic, but luckily for you he didn't go into "gay panic" mode the way all too many hetero and closeted guys do. He might've been worried that he was "sending out the wrong signals" and setting off gaydar, no matter that his reaction tells me he wasn't dangerously homophobic. Straight fellas have gaydar, too, y'know. ("Did I spend too much time on my hair? Are my pants too tight around my butt? Something must've given this dude the wrong idea...")
I've run into weird shit like that from time to time. You're close by somebody at a bar, you're both getting your drink on, and a casual remark starts you talking. You "click" and start phasing into heavier conversation and enjoying it. Lingering glances are exchanged. It becomes clear, at least to you, that you're mentally undressing each other. Then it's time to make the next move. You say, "Wanna knock back a few more at my place?" He leaps off his barstool, throws a stack of bills at the bartender, and beats feet out the door after perhaps muttering a quick "I'm outta here" or "Nice talkin' to ya." Go figure.
After all this social progress there are still armies of conflicted "bi curious" types out there. Your guy could well have fallen into this category. It's better that you had the exchange you did, instead of the nerve-wracking kind when you're hit with "Are you gay (or a not-so-nice term)?" Whether he went home alone at the end of the night and beat off thinking about that guy who scoped him in the john and could've helped his "curiosity" isn't your problem.