I didn't really think Tom was actually gay in the movie. I never saw Dickie as gay. Even Freddie had many hand gestures and things he said that kind of made him look on the 'gay side'...yet I think this was meant to be an upper-class, high society-type thing. Freddie mentioned being into 'the women' a couple of times. I think Tom was obsessed and wanted to be Dickie. I know he was checking him out naked in the tub scene--but I always saw this as admiration and envy more than anything actually sexual. He wanted to be beautiful and tan, like Dickie. I didn't see that he was in love with Peter, either. I thought he used him as a sad replacement for Dickie (who was dead by then) and perhaps also as a free ride, money-wise. I know he used Dickie's ID and got money out of the bank, but how long would that have really lasted? He couldn't continue to do that after he saw an investigation forming, so surely the money ran out.
I sort of thought Tom was 'appeasing' Peter so he could continue to tag along, being that Peter made it very clear that he was gay. I think he liked him very much as a friend and really craved feeling loved and admired by someone. Peter filled this need for him. He wanted to be adored and admired like Dickie was by so many.
I definitely never thought Dickie was gay. I thought he was a narcissist who loved any attention. He led Tom on a little because he really loved and craved being admired and doted on... by anyone.
I guess I never saw any real sexuality in Tom. I saw a calculating sociopath who wanted to be loved, to have 'the good life' and to be accepted by this upper-class group of people as an equal. I think Tom would have 'been' with anyone (male or female) to stay part of this group and continue to live this life. This is just my take on it, though.