I don't think the costumes were for that; if there are spirits that are benign, then the opposite is true as well. Such entities..or demons even, might want to remain in the world of the living, and to do that they need a living host.
The idea was to either confuse or scare them from possessing you.
In parts of my country, the day after Halloween is called 'Day of the Dead', families go to the graves of their family. They decorate them and leave offerings like alcohol and their favorite foods, and toys if it's the grave of a child.
My years in the military, I've grown to appreciate that more then the scare-fest that this holiday's become.