I strongly suspect Hans Christen Andersen had witnessed seeing poor girls selling matches on the street, leading him to write The Little Match Girl. There is a truth behind that story which I think comes across powerfully. Oscar Wilde's The Happy Prince to me conveys what I think Wilde would have liked to have seen happen. The statue Prince in the tale knew his gold leaf would only be of benefit to people if it was taken off and given to poor people to sell so they could make ends meet.
So fairytales should be taken seriously I think. They're not just for kids. Indeed the original versions of so many of the tales are not suitable for the under-18s. Disney could never have filmed The Little Mermaid as Hans Christen Andersen originally wrote it. There is no happy ending in the original. The classic fairytales are carefully crafted stories (and/or reworkings of even older tales) and should be appreciated as an art form in their own right.