"I just wanted to know that IF/WHETHER you were gay" sounds more natural though.
Who tells you that 'were' means it's not true anymore? Do tell this from the cases like 'If I were you'.
In this sentence things are happened in the past, I wantED to know that you WERE, so actually we rarely say I wantED to know they ARE, which means I don't know if they are gay right now, this is outta the question. We are talking about things you wantED to know.