They have diametrically opposed cultures
Hobgoblins, though generally opposed to most other races besides their fellow goblinoids, have been described as having a specific hatred of elves since the earliest editions of D&D, with the 1e Monster Manual noting that:
If elves are nearby, hobgoblins will attack them in preference to any other troops because of the great hatred they bear.
The MM doesn't go into any further detail to explain why this is the case, but the 1982 Dragon #63 article "The humanoids" features a brief examination of the cultures of some of D&D's humanoid 'monsters', including hobgoblins. Of their relationship with elves, it says that:
It seems that much of the dislike hobgoblins have for elves comes from the latter’s “heretical” emotional displays as well as the elves’ diametrically opposed alignment. Hobgoblin shamans emphasize the revolting, un-warriorlike aspects of elven life as often as they can, and preach about what a shame it is that elves should be allowed to run loose like they do.
Essentially, the repressive martial culture ascribed to hobgoblins directs them to avoid external displays of emotion as unbecoming of warriors. D&D's elves are generally described as being quite openly emotional and prone to revelry (in excess of most other races), which is considered taboo in hobgoblin society, and the religious leadership of the hobgoblins use them as a specific example of behaviour to be avoided and a common enemy to rally against.
Also, elves are the most significant race that are stereotypically chaotic good, which is directly opposed to the stereotypical hobgoblin alignment of lawful evil. The article notes that while hobgoblins are also opposed to dwarves (due to the latter's... "innate goodness"...), they do have some grudging respect for them, since dwarven society trends to the lawful and dour, which aligns with hobgoblin culture.
These aspects of hobgoblin society, having been established in the very early days of the game, appear to have reliably persisted through subsequent editions. The 2e, 3e, and 5e Monster Manuals (or equivalents) all note that hobgoblins hate elves and will attack them in preference to any other enemy; the 4e MM notes that they especially hate elves and eladrin, though unlike the other texts it doesn't specify that they will always preferentially attack such enemies. (The usual disclaimer that ascribing culture and alignment to an entire race in the way that D&D likes to do is problematic and racist applies, of course.)