These unnamed dudes populate the tales and serve to show how high the stakes are when it comes to rescuing the princess, accomplishing a difficult task for the princess's hand, and stuff like that. Mostly they do this by failing. Sometimes spectacularly. Usually they lose their heads while they're at it. Examples include the failed suitors in "The White Snake," "The Riddle," "The Six Servants," and "The Little Hamster from the Water."
While they do a great job of inspiring pity, these guys also show us what the social landscape of the tales is like. Competition for a worthy bride is pretty brutal. This is partly the fault of magical factors but it's also because fairy tales exemplify the principles of supply and demand. Princesses are in demand, but there's not a lot of them to go around. So some of the suitors are bound to be disappointed. And because fairy tales often employ exaggeration to make their point, many of these dudes, rather than simply being rejected like a geek at a Hollywood bar, are killed instead. Sorry, nameless suitor dude, it sucks to be you.