Gene Roddenberry had the proposal in 1964 (it was nameless at the time). He intended each episode to have both an adventure story that was suspenseful and interesting as well as have a moral to the story.
NBC didn’t like the first episode “The Cage”. They also had other dated issues with the show…. there was a woman in a command position, and an alien that looked too much like the Devil (Spock). We now know the beneficial impact both characters had upon society. NBC decided that they thought the series idea was still good, so they commissioned a new pilot episode, “Where No Man Has Gone Before“.