Star Trek II: The Wrath of Khan was one of the best films ever put to film for a Trek property. It featured a good story, a great villain, and an ending that has touched millions, if not hundreds of millions of people who have seen it. It's one of the most quoted and most beloved Star Trek films ever. It was also supposed to be the end of Leonard Nimoy's time with the franchise after almost 16 years of playing the Spock character.
But there were just some issues with believing that Nimoy's Spock was dead. There was the ominous shot of Spocks' casket on the planet Genesis, the expectation from the media that this was just a ploy (it wasn't), and a minor moment that Nimoy improvised in one scene, all of which combined for the perfect storm to bring Spock back. It was serendipity.
And that one moment that was improvised that tied everything together? When Spock mind-melded with Leonard "Bones" McCoy and urged him to "remember". That last bit of dialogue was added during the scene and it worked. Fans latched onto it as a belief that Spock would return. Nimoy didn't intend that, apparently but it opened up the opportunity for Paramount to call him about returning for the the third film.
The line came from Wrath of Khan writer Harve Bennett, according to DeForest Kelley's biography, From Sawdust to Stardust (via SlashFilms). While Bennett didn't write the line, he encouraged Nimoy to add something to the moment, and to which "Remember" took shape.
In the book The Fifty-Year Mission by Mark A. Altman and Edward Gross, Bennett explains that the concept for Star Trek III became so much simpler after seeing the second film, saying;
"One, there is a casket on a planet that has been created by the reformation of life forces, and life has been created from death. Two, 'There are always possibilities.' Three, before he died, Spock said, 'Remember.' Remember what? The puzzle was solved so easily that I think seventeen other people could have written the script to 'Star Trek III.'"
Sadly, while Bennett may believe that the film could've been written easily by many others, maybe finding one person who can do it well was the real goal. Search for Spcok is one of the more panned Trek films of all time. It's not overly celebrated and for good reason. It's janky, it lacks the logic the film prior and it all collides into a mess of storytelling, especially with the James Kirk character, who loses his son but is seemingly unbothered by it when Spock returns.
Very odd writing.
Maybe it had something to do with the rapid aging, or the lack of a memory while doing so. Maybe it was just a bad idea. Who knows, but what we do know is as good as Wrath of Khan was, The Search for Spot may have been just as bad.