The specific line you've referenced is the first line of three verses that describe the arrival of Smaug at the Lonely Mountain:
The pines were roaring on the heights,
The wind was moaning in the night,
The fire was red, it flaming spread,
The trees like torches blazed with light.
The bells were ringing in the dale,
And men looked up with faces pale.
The dragon's ire, more fierce than fire,
Laid low their towers and houses frail.
The mountain smoked beneath the moon.
The dwarves, they heard the tramp of doom.
They fled the hall to dying fall
Beneath his feet, beneath the moon.
Pines only roar when on fire. The forest is on fire because of the dragon. The roaring pines are the poem's first reference to this fire.
A large forest fire also creates a wind, due to the oxygen being pulled in to feed the fire, and the hot air from the fire rising into the atmosphere. This is the moaning wind.
Just in case the reader/listener missed the references to fire there, the next two lines make things pretty clear by explicitly mentioning fire and flames, as well as saying that the trees blazed like torches.