There's plenty of ways how a pleasant thought can bring sad thoughts to mind but in this context, Wordsworth is grieving the condition of humanity.
As the proceeding lines below state,
To her fair works did Nature link
The human soul that through me ran;
And much it grieved my heart to think
What man has made of man.
And again, at the last stanza, ...
Erlkönig is not a children's poem. In the poem, a boy is assaulted and killed by a supernatural specter, while his father cannot even perceive the threat and is thus unable to defend him. That would be quite unsettling for children. Also the poem is mostly dialog, and the son, the father, and the eponymous Erlkönig speak in turns, with no indicator whose ...
There's not a hidden sub-text as far as I'm concerned. Just because it's a "children's poem" doesn't mean good music can't be made out of it! For other examples, check out Peter and the Wolf by Sergei Prokofiev, or Little Red Riding Hood by Sergei Rachmaninoff.
Also, the lyrics of the poem were written by Goethe, who's known for his dark imagery ...