He, himself, was most likely a closeted gay. It has been reported that he used gay dating sites and apps. A former classmate of his said he had been asked out by him. Hie ex wife speculated that he was gay as well.
He could not reconcile his gay self and his religious self, so he attacked the gay club, knowing it was a defenseless place and died a ‘hero’ martyr for Allah................
I disagree with that analysis - although I recognize the facts that you state. I’ve just reached a different conclusion.