I have a theory about this. The guy was not actually a closet gay. He was probably looking for potential victims, maybe for another scheme.
This is supported by the fact that this guy exhibited bad behavior:
Two people who worked at Pulse said they also recognized Mateen as a customer. One of them, head of security Estella Peterkin, said she had to kick him out multiple times for bad behavior.
If you were a bona fide gay person, you would want to behave and stay in the club to meet people. He did not seem to want to really meet people, maybe just find them for his plans (whatever they were).
He might have been behaving bad because he just got pissed off whenever he interacted with a gay person and could not control himself.
He was using a gay chat / dating app maybe for the same reason, to find victims.
Perhaps he wanted to murder some gay people in another manner and send a message (say, like a serial killer with a series of murders).
So maybe this was taking too long and he then decided out of frustration that to execute his religious imperative, he just need to do the shootout instead.
So this has nothing to do with gay tendencies or whatever, IMHO, but is part of his overall religious extremist plan.