The Shy Guys are a nomadic people, native to Yoshi's Island, who migrated to the Mushroom Kingdom. The masks they wear are a means of tribal identification. They are the same species as Snifits, though a different tribe, as shown by the different masks. The Snifits, since they have projectile weaponry in their masks, are more violent than the mostly mild-mannered Shy Guys. The Spear Guys are simply tribes of less civilized Shy Guys.
I just made that up