Veering slightly off topic here. I know - shocking.
What was the legality of the Blish adaptions?
They were licensed and legitimate tie-in publications. They worked the exact same way tie-ins have always worked since well before
Star Trek: The studio licensed the publisher to do it, and the publisher hired an author. From the studio's perspective, it's the same as any other kind of merchandising -- you contract someone to produce that merchandise to promote your product, whether the merchandise is books or comics or toys or t-shirts or posters or Christmas ornaments or breakfast cereal or whatever.
Why wasn't Ellison suing him for ruining COTEOF as well?
How about the other episode writers? Did they get a cut of the profits?
Harlan Ellison's litigations against the
Crucible trilogy and the Hallmark COTEOF ornament were because they were excerpting verbatim dialogue from his episode and he claimed he was entitled to compensation for that. If that claim was true, and he hadn't been compensated for the Blish adaptation, presumably he would've sued at the time, since Harlan Ellison was not known for being slow to sue people. Since he didn't, as far as I know, then it follows that either he did get compensation or he wasn't contractually entitled to it.
Did other series like Lost in Space get episode adaptions?
Episode novelizations and original tie-in novels were common for many TV series at the time, though I can't think of another one that was adapted as comprehensively as TOS was, rather than just the pilot or a handful of episodes. It's a testament to TOS's enduring success in syndication that there continued to be a market for more volumes years after the show had ended.
As for
Lost in Space, it had a 1967 tie-in novel by Dave Van Arnam & Ron Archer, though it seems to have been an original novel rather than an adaptation. There was a sort of comic-book tie in, but only technically; Gold Key had already been publishing a comic called
Space Family Robinson (inspired by
The Swiss Family Robinson, which was also Irwin Allen's inspiration for LiS), and though the specific characters and premise were different, they were similar enough that they worked out a licensing agreement where Gold Key added
Lost in Space as a subtitle to make it seem like a tie-in.
However when the reruns came on I realised the books were wrong.
Then I heard that Blish had never seen the episodes and was working off some old scripts or something so then I thought good job with what you had.
...
However I'm not certain what leeway Blish had considering they weren't his stories in the first place.
He had a fair amount of leeway, because back then novelizers weren't expected to be slavishly exact, but were free to bring their own interpretation to a work. In the early volumes, though it's true he was working from early drafts, Blish also added his own embellishments, like new material to make the stories more scientifically plausible (he was the one who first proposed 40 Eridani as Vulcan's primary star), and allusions to concepts and events from his own
Cities in Flight series, such as the Vegan Tyranny and the Cold Peace.