The Squire of Gothos is one of the "sillier" episodes of Star Trek, and therefore one of the most entertaining ones. The entertainment factor is, generally speaking, fueled by the stand-off between William Shatner and the episode's hilarious guest star, William Campbell.
During an unspecified routine mission, Sulu suddenly vanishes into thin air, and Kirk follows soon after-wards. Spock immediately begins looking for his missing colleagues (and, though he'd hate to admit it, friends), while the two stranded crewmen must deal with the mysterious, all-powerful, flamboyant Trelane (Campbell), the self-proclaimed Squire of Gothos, a being capable of creating or destroying anything he wants through the sheer power of his mind.
At first sight, the plot may seem recycled from previous episodes (honestly, are there any sci-fi shows that didn't feature at least one God-like character), but that feeling vanishes pretty quickly thanks to the script's winning use of exaggerated humor, all conveyed through Campbell's deliberately camp performance: his Trelane is essentially the Trek version of a spoiled child in the body of an adult, while his ignorance-fueled curiosity for the human race (his knowledge is quite limited) probably served as inspiration for Gene Roddenberry when he came up with the character of Q for the Next Generation pilot, some two decades after this episode aired.
In short, the key to appreciating The Squire of Gothos is this: "silly" doesn't necessarily equal "bad".