Explains a lot of what he does, really. His sole romantic prospect was Fiona Fox, but she starts dating Sonic, resulting in Tails having an emotional breakdown; ostensibly over Sonic dating his crush, but these could be confused feelings. Sonic dating another fox? That's got to hit closer to home than all the other random floozies hanging off Sonic's nutsack. You could argue that Tails only ever wanted Fiona in the first place because he sees Sonic with so many girls and he figures he should be like that too. I mean, he's still just a kid. You can't really say that his attraction to Fiona was based on legitimate sexual urges. It's puppy-love, and probably largely performative at that.
I think his hero-worship for Sonic is definitely genuine, but there's going to be a period when he starts to mature and realize that he has "other" feelings for his friend. This leads to feelings of angst and confusion as he tries to reconcile his sexual identity with his long-standing friendship. Was he really just in love with Sonic all along? What does it mean if the heroic ideal he lived up to was just the result a dumb, misunderstood crush? Would Sonic reject him as a friend if he knew? Why does he have to feel this way?
Sonic, of course, knew from the very beginning, but didn't want to mess with the feelings of an innocent kid, still unburdened by such harsh realities. They eventually talk it out, and while Sonic can't return his feelings, they come to an even stronger bond knowing that their friendship really was true all along, and something as trivial as sexuality can't ever destroy that.