Even within the realm of Tom Bombadil things aren't safe. Tom himself is not evil, but like nature itself he's not all good nor all safe, and nor are his lands. He does come to their aid, banishing the wight "Where gates stand for ever shut, till the world is mended." But Tom's merriment does not abate even after such a dire encounter, finding even amusement at the hobbit's predicament.
I don't even think the barrow-wights are evil. They are remmnants of lives and deaths past. I don't think that entombing the hobbits is an act of particular malice, but the living don't belong deep within the barrows and the wights treat the dead with respect, laying them to rest. The wights were men that fell to an evil king, men who stood against the dark lord and even in death guard "from evil things folk that are heedless." The barrow-wights don't show up in the film at all, possibly because the whole passage with Tom was excised, but also perhaps because they would have been too easily confused with the ring-wraiths on screen.
This is the chapter where Frodo finds his hobbity core of courage, a seed that needs to grow. Fortunately, part of this seed is initiative, with Frodo realizing the name "Baggins" is best left behind, as they follow Tom's advice to seek out the Prancing Pony in Bree, and as they leave the Shire behind.