The term "evil dwarf" is actually an old Victorian fiction trope. The general idea is that a dwarf was a misshapen human being, so it must have been touched by a demon or devil which warped or twisted it in the womb. The trope can be seen in many stories over the years, from the fairy tale Rumplestiltskin to the Mule from Isaac Asimov's "Foundation" series to the Game of Thrones novels by George R.R. Martin.
In general, the evil dwarf was there to tempt the hero or to lead them astray. GRRM actually played on this to set up his Game of Thrones character Tyrion Lannister, making him a good man while everyone around him despises and curses him to the point of calling him an imp to his face.
Iron Noder 2017