It's up to the situation. If I'm a kid at a party, and everybody wins some kind of raffle except me, especially depending on the age of the child in question, that just sucks, and you might not learn anything if you're always losing and too focused on how unfair it is because kids don't always think critically. There'll be plenty of opportunities at school, church, etc. etc. where a parent/parental figure/family member doesn't control the winner for the child to learn that lesson. School fundraiser events, for instance, in mine they spun a wheel and chose a student at random to win money, game consoles, etc. That just sucked, nobody there cared who won or lost, but it wasn't personal and did teach a lesson to an extent.
I also think the behavior of the child following the situation is important to consider, yeah. I'm not saying flat-out to spoil them every time fate frowns on them, just that it takes a lot more than giving them a little joy when they learn bad lessons sometimes to raise them to not understand the concept of losing.