Gambling involves risking a particular amount of money, an asset, or anything else in exchange for the fun that you are deriving from the game, and in return, you also expect to make a little win from the game, making you either happier when you win, not just because you won the game, but because you also make some profit, or vice versa when you also lose a game.
I agree to the first part of your statement that if the game involves money then it is gambling. Rest there are so many computer games which we cannot classify as gambling because there is no money and no financial risk involved in them.
However, we cannot classify the games based on emotions. We just cannot say that the games that make us happy is gambling because we win some money. Even people are happy winning Arcade and other computer games without involving money. Also, I have seen people getting sad about losing a game to a computer or from any other person even though they have to spend or lose no money.