We figured out Where and when did "the GM is always right" get codified first? to the early days, or more precisely, it predates the main bulk of AD&D and can be pinned to have shown up in the 1970s.
This question is about the general rule/goal Have Fun. We find it nowadays in a lot of games, expressed in various ways. Some examples:
Exalted 3 (2016), p24:
How to Play This Game [...] Unlike most games, there’s no fixed way to “win” Exalted. The goal isn’t to advance your character to some ultimate victory-point; rather, the goal is to have fun telling an engaging story with your friends.
Gurps 4th Edition - How to be a GURPS GM (2014), p4 (emphasis as in print):
Introduction [...] There is absolutely no One True Way, no “official” way, of running or playing GURPS! The whole purpose of the rules is for everyone, the GM and players alike, to have fun, no matter how they do it.
Dragons at Dawn (2010), p30:
Arguing [...] Now if the players are arguing with the Referee, everyone should keep in mind that the point of playing games is to have fun. Rules be damned; if no fun is being had then work together to change things so everyone is having fun or else go watch a movie.
It does not suffice to have "Have Fun" called out as a goal when trying to explain a different point, it has to be able to stand alone like in the three above examples. A non-suffiient example would be Basic Dungeons & Dragons Dungeon Masters Rulebook(1983), p2, that does not demand that fun was the overarching goal of the game but merely uses it as an illustration how fairness was to be expected:
There is one rule which applies to everything you will do as a Dungeon Master. It is the most important of all the rules! It is simply this: BE FAIR. A Dungeon Master must not take sides. You will play the roles of the creatures encountered, but do so fairly, without favoring the monsters or the characters. Play the monsters as they would actually behave, at least as you imagine them. The players are not fighting the DM! The characters may be fighting the monsters, but everyone is playing the game to have fun. The players have fun exploring and earning more powerful characters, and the DM has fun playing the monsters and entertaining players. For example, it’s not fair to change the rules unless everyone agrees to the change. When you add optional rules, apply them evenly to everyone, players and monsters. Do not make exceptions; stick to the rules, and be fair.
When was the first time a clear "Have Fun" was put into a game's rule book as a leading idea that one should achieve for all the group?