Did I went too far with my joke?

I am a sikh guy (it is related to the joke). When I reached coaching, I was feeling little cold, and the class room's AC was turned on. So i was shivering a little. My friend asked me what happened? I told him that i am feeling cold. Then while talking I said I dont like this AC of our class(i thought lets crack a joke).. he asked me why? I told "Blue star ka hai". There was awkward silence among us 5 guys, and one lectured me that i should not be saying such things and i am insensitive.. Did i cross the line?

Originally i posted this on AITK, saw positive response, so decided it to share this with you all.