It’s consistent with how he’s responded to tweets like this in the past—‘you’re a fag but you have a quality voice’ (as if there’s a contrast there, as if being gay is bad)—and Harry responded ‘I’m going to go with thanks?’ He refuses to rise to the bait of treating being gay as something to be ashamed of, and responding in that manner is a subtle way of calling the person out for it. But being in the position that Harry is, he can’t exactly ‘confirm’ his sexuality. And no, Harry has never stated that he’s not gay.
I don’t read Harry’s response as a denial that he’s gay.
I do find it interesting that he chooses to respond at all, instead of outright ignoring these kind of homophobic messages. I think he would /like/ to be in a position to fight back against the homophobia in a more direct way.