I read Warren Spector talking about this (whether games have to be "fun") in The Escapist. Warren is a good guy. Anyway, since it's such an easy question, I thought I'd take a crack at it.
Well, what is meant by the question though? It could have two meanings:
1) Do games have to be "fun" to sell well? (not exactly)
2) Should games be fun? (not necessarily)
Should Games Be Fun?
I'll take the second (easier) question first. Should games be fun? Certainly we have fun playing games and we can mention many games that are fun that we like and many games that aren't fun that we don't like. But fun is only one narrow state of mind and interactive entertainment has far more potential than just that.
There are some other states that exist in games already that we tend to lump into "fun" whether the word fits or not. The word "relaxing" or even "contemplative" might describe some games. Occasionally, there is a glimmer of being emotionally moved in story-based games. That might not be "fun" but it's perhaps even better.
Consider the movie Schindler's List. I would call it moving and important. I wouldn't call it fun. It's hard to imagine our culture if we were to remove all the films that were not "happy" or "funny." Some day in the future we might call the sphere of interactive entertainment something other than "games" and there will be entire genres of interactive entertainment that are moving or sad or romantic. Games would be just a subset of that sphere. Phew, I wrote a couple sentences without quotes around random words.
Do Games Have to be Fun to Sell Well?
Games are memes: non-genetic information that is copied/imitated and passed on amongst humans. You could say that the act of playing a game is the meme rather than the game itself, but there's no sense getting caught up in that yet. Memes--like genes--get copied if they...well...have properties that get them copied. There is the mistaken notion that genes and memes get copied because they are good and useful. Being good and useful is one of many, many reasons that a gene or meme might be successful.
Consider the folding of paper cranes that occurs in many elementary schools. It's relatively easy for one child to teach another the process of creating such a paper bird. The instructions are passed on (rather than the product being copied), which keeps the integrity of the copies pretty high. Imperfections in one child's crane aren't necessarily passed on to another child's. Anyway, there are elementary schools that have been making cranes for 30 years or more, and I don't think it's because it paper cranes are solving some big human problem. For whatever reason, it's a successful meme.
Memes can be harmful and still be copied. Consider the memes "copy this and pass it along" and "make money." There's not much reason to do the first and no clear instruction on how to do the second, but when the two ideas found each other, the meme for chain letters and pyramid schemes were born. These things are frauds and don't help anyone, but they are popular memes that live on today.
A meme needs some tricks to stick in your brain. It needs to be easily copied. It needs to stand out from other more boring memes like the story about someone's dream last night or jury duty. Memes compete against each other for space in your brain, and have no regard for you--other themselves. If they can be copied, they are copied. Survival of the fittest memes gives us some wildly popular ones. But again, memes don't care about helping you. Being helpful is just one trick to get copied, but there are many others.
So do games need to be fun? The property of fun is one reason why a game would be copied from player to player. Another reason would be that the game is addictive. That is, the game is specifically designed to tap into the so-called irregular rewards schedule that psychologists know is one of the most powerful behavioral trainers. (That means that you do x and you have a fairly low chance to get a reward. It's an addictive pattern because you don't know when you'll get it, but you know will get the reward if you stick with it long enough, and maybe you'll get two rewards in a row if you're lucky!)
Anyway, a game that was purely addictive but no fun might not sell well. A game that is incredibly, highly addictive and has just enough fun might sell very well. It's not simply "the more fun the game is, the more it sells." I could go into marketing or whatever else, but I think the design pattern of addiction illustrates that there are other things than pure fun that could make a game a big hit.
We already have unfun games that perpetuate themselves.
Hopefully there will be games in the future that are not fun in the way we mean it today, but have even deeper importance--and don't use the addiction trick (much).