In general a hard fought loss can be beneficial in the long term, however, a lot of this depends on what has been lost in the battle. For example, the above example in favour of this point, about learning Spanish, this is a great example for a loss to be considered valuable for a longer term gain. However, if this same logic is applied to, for example, WW2, then I would have to say a hard fought loss (tons of casualities, etc.) is not better at all.
A loss, hard fought, may gain you more than an easy victory. For example, if you are a native spanish speaker and you choose to learn Spanish in high school. This would earn you an easy A. However, taking a Japanese class or a Korean class would definitely teach you more. And even though you get a B in that Korean class, I believe that the Korean class would be more valuable to take than the easy A Spanish class (If you're Korean, taking that Spanish class would be more valuable).
I never saw a happy looser. Victory is always a fascination for every competition. I never saw a sad victorious person ever. You will call him mad if somebody gets sad after winning. Victory is more valuable. It's shows your courage it provides you courage it shows your efforts, it gives to opportunity to move ahead and do good. There is no alternative or replacement of victory.