Video games are supposed to be fun. If a game wasn't fun to someone somewhere then it wasn't a very good game. However, at the same time fun can mean a lot of different things to a lot of different people.
Just because video games are supposed to be fun doesn't mean that everything in them has to be geared towards fun. Fun is often not that simple.
Fun can come from all sorts of emotions that aren't positive by themselves such as fear, sadness, and even anger.
If you only focus on creating fun through means of fun, you're really limiting what kinds of fun you can create. Some kinds of games don't benefit by making certain elements more fun, or may even be hurt by it.
Take horror games for example. Horror involves inducing fear. Fear by itself is a negative emotion, and in order to cause it there are many situations where you have to cause the player some pain. A lot of the recent horror games are terrible at being frightening because they try to make combat enjoyable, but how are you supposed to be afraid of something if you enjoy killing it? With horror games you often have to intentionally make combat at least somewhat un-fun and something the player does not look forward to doing. I don't care how ugly your monsters are, if I enjoy blasting them to bits then it's safe to say I'm not really afraid of them.
The same goes for puzzle games as well. Puzzles don't stay fun for too long and aren't very rewarding unless they have some difficulty to them, and that means causing at least some frustration. To be fair there is nothing wrong with easy puzzles, they don't all have to be crazy hair-pulling difficult, but if they're all smooth sailing all the way through the novelty is going to wear off fairly quickly. Even Portal had to toss in a few painful ones somewhere to keep things interesting.
Where else have you seen fun that is best served with a side of pain?