I know I’m probably not a real asshole for this but I would like to know if I should not have done this- I hope that’s acceptable. 

I’ve been in a new class since a few weeks, and I don’t know most people in it very well yet. Last week we had an excursion and when everyone went home after that I ended up with one guy from my class who had to take the same train as me for about an hour. 
We made some small talk about work, how we liked our mayor so far, and what we wanted to do after uni. It was all fine, but the I shared that I found out another guy from our class is a very religious person and that I was surprised by that. He agreed, and then I told him I wondered what the other guy his stance on gay marriage is, because I’m bi myself. He replied.. like I made him kind of uncomfortable and he didn’t know what to say. I quickly steered back to small talk and when I left we said bye but it felt awkward to me, and I felt like everyone in the train cabin was staring at me like I’d broken some social rule (they’d all been able to hear the conversation) 

So, should I not have brought up a big topic like gay marriage with a (straight) guy I barely know? I’ve always had a hard time sharing personal things with people and I’m afraid I’m overdoing it now that I’ve realised that it was a problem, if that makes sense. 