Historically there are few public places you could be openly gay and not be harassed, concerts are one of those places.
I think this is putting the cart before the horse. Why concerts as the original venue for that? Probably because concert people tend to be more gay.
I can confirm that this stereotype is almost nonexistent in Europe (at least in Italy and France, not sure about other countries). No one in Italy would immediately associate singing in the opera or playing the organ with being gay. The only classical music-related thing that can be considered stereotypically gay even in Europe is being a male ballet dancer.
Aesthetically, opera seems like it slots in well to a Very Gay modern niche, in that it is flamboyant, is dramatic to the point of histrionic, lends itself well to backstage scuttlebutt about prime donne and other such inside baseball dish, is nicely campy in its traditional overwroughtitude of costume and set design and vocal fireworks and Götterdämmerung, and is a good object to lavish conspicuous aficionado-points on. It's as gay as green is Irish.
Hmm, I don't know how this got started, but once it got started, there's a really obvious mechanism for continuing and reinforcing it; if you're gay and you want to meet other gay people, and you've heard there's gay people at the opera, then now you want to join the opera. Also if you're really homophobic and want to avoid gay people, then you'll avoid the opera, which might then make it safer for gay people.
I could randomly start a rumour that gay people really love aikido, and if I was sufficiently successful at getting everyone to believe it, then maybe it'd soon become a self-fulfilling prophecy - since homophobes would pull out of aikido, and gay people would join.
I wonder how you could test this? Could you just survey some opera fans about why they enjoy opera, and see if anything shows up as correlated on the demographic-monitoring bit of the survey? Could you do some kind of experimental design where people are told about an imaginary new hobby you've invented, and told that it's common or uncommon among their demographics, and then they rate how interested they are in the hobby?
I have recently spent a lot of time on classical music forums, especially opera. There are more gay men than you would expect by chance. We have discussed it a few times, and it seems, classical music is considered a gay interest in the USA. Opera is the most prominent, the soprano voices are a stereotypical source of gay fascination, but even playing organ is suspicious, and meeting other organ players is supposedly almost as efficient as visiting a gay bar. They admit, these indicators would be very unreliable in Europe. Being European is also one of the few excuses in the movies for loving classical music. What is the origin of the stereotype of gay men loving opera or classical music ?