Do you mean from a historical standpoint? It depends on the culture, but it's pretty recent in its current iteration — in the west, it followed the rise of Christianity. For much of western history at least, it was considered OK to pitch, within reason (manly!) but not to catch (effeminate!). Warring states China was pretty similar. I'm less familiar with India but in any case that would have been suppressed by the Mughals.
And yet Thailand has had numerous genders for centuries(?). I was reading about it it’s fascinating they have a third classification with numerous sub-gender types such as Kathoey, Tom, Dee, Tom-Dee, Tom-Gay, and many more.
I think you'd find very different versions of homophobia based on cultural norms of the time and region. Romans and Greeks were quite different in ancient times.
If you define homophobia as targeting other individuals for their homosexuality, it's quite documented in dolphins. They will gang assault (the bad kind of gang assault) other dolphins they see as fair game, often based on what their relationship status is.