It is said to carry wandering spirits to the place where they belong so they can move on.
(From  Bulbapedia) Pumpkaboo is a bipedal Pokémon that resembles a pinkish pumpkin. It comes in four different sizes: small, average, large, and super sized. The pumpkin body has a pair of circular holes carved out of its rind that resemble eyes. The ghostly body that lives in the pumpkin is black with a pointy collar, yellowish eyes with no visible pupils, a pair of fangs, curved ears and a curled stem. Pumpkaboo can release light from the holes on its body, making it similar to a flashlight.
The spirit residing in the pumpkin is trapped in this world. Pumpkaboo can carry wandering spirits to where they belong, so they can move on. It and its evolution Gourgeist are the only known Pokémon that can learn Trick-or-Treat.
(From Bulbapedia)Pumpkaboo is based on a pumpkin, specifically the ones carved into jack-o'-lanterns for Halloween. Pumpkins are also known for their variety of sizes, possibly contributing to the four sizes Pumpkaboo comes in. Considering its fangs, black upper body, and affiliation with Halloween, it may also be based on bats, which are also associated with the holiday.
(From Bulbapedia) Pumpkaboo may be a combination of pumpkin and boo (a common word used to startle people) or peek-a-boo.