Actually, that's a myth. Both Lost in Space and Gilligan's Island had second pilots ordered and produced before CBS purchased the shows. Even GR's comments on the situation is that it was "virtually unheard of..."; but Star Trek was not the first show in TV history to have a second pilot ordered.
Not exactly. Strictly speaking, there's a difference between a pilot and a first episode. A pilot is a demo reel for the series, a tool for selling it to the network. In the case of Lost in Space, the original pilot succeeded in selling the show to the network, but then, after the network had ordered production to begin, the show was restructured in a way that required breaking up the pilot footage across four of the first five episodes.* In the case of Gilligan's Island, the original pilot failed to win over the network, but Sherwood Schwartz then made a different cut that was closer to what he wanted (and added the famous theme song) and had it screened for test audiences, whose phenomenally strong reactions finally convinced CBS to buy the show. Again, it was only after the show had been sold that the network ordered changes that led to the original pilot not being used as the premiere episode (with much of it being cut into a flashback episode later in the season).**
The Star Trek case is very different. Saying "We're buying your show, now we want you to make these changes and give us a new/altered first episode" is one thing. Saying "We're not buying your show, but we're willing to pay you to make a totally new attempt to sell it to us a second time" is a whole other thing. Never before had a network footed the bill for a whole second pilot of a show they hadn't even bought yet.
*Source: James Van Hise, Lost in Space 25th Anniversary Tribute Book (Pioneer, 1990), p. 7
**Source: Joey Green, The Unofficial Gilligan's Island Handbook (Warner, 1988), pp. 5-7
That's interesting because with regards to LiS, I thought the Netwrk paned the original pilot; and told Irwin Allen that he needed more drama, so he then did a second pilot that included the 'evil spy' character of Doctor Zachary Smith; recut using some of the first pilot footage to make the second pilot, and that's when CBS greenlight.
As for Gilligan's Island - I have read that yes, the first pilot was indeed recut; and based on that recut the network then ordered another pilot (but didn't pony up the full cost, so Schwartz put up a portion of the funds for the second pilot himself); and there were (like in Star Trek too) some major cast revisions (there was a female secretary named 'Bunny' in the first pilot, who was completely ropped and replaced with a brand new character 'Ginger'; because audiences hated that character; and also the personalities and character backgrounds of a few other characters were also reworked. The original pilot couldn'tr be aired because it was just too disconnected from the changes in the second pilot - which does mirror what was done with the two Star Trek pilots to a great degree.
But