Perhaps more than any other TV series, Star Trek, which first aired 50 years ago this month, impacted on the real world, inspiring generations of scientists, physicians and fans. The first space shuttle was named “Enterprise”; in design terms, the “communicator” is the forebear of your smartphone; a curious linguist from Minnesota, one Dr d’Armond Speers, experimented with bringing up his son by speaking only Klingon to him. (His son resisted the experiment.) Yet in the end, the show’s appeal is that of being a world unto itself: it invited us into a self-contained community on a moving fortress, which brought us into touch with unfathomable strangeness beyond.

The show’s creator, Gene Roddenberry, and his sometime collaborator, Gene L Coon, were both veterans of the US’s Pacific war. Members of the “greatest generation”, marked by conflict, they were strongly committed to a vision of social life framed in negotiation, mutual understanding and compromise. Happiness is Star Trek’s secret. Unlike in Doctor Who, there is very little actual wickedness. Though in one episode we encounter the spirit of Jack the Ripper, more usually there’s merely petulance or misunderstanding, hurt or fear. It’s a matter of survival, not evil; it’s rare to find someone who wishes to conquer the galaxy. Cold war politics stand some way back from the show, mainly there in order to be circumvented. Having a sympathetic Russian, Chekov (Walter Koenig), on the bridge, was in its own way as radical as casting a Japanese-American (George Takei) as Sulu and an African-American woman (Nichelle Nichols) as Uhura.

Each week, Kirk opened the show by declaring “Space, the final frontier”. The receding frontier was always central to an idea originally pitched by Roddenberry as “Wagon Train in space”. Myths of the voyage are at the show’s heart, drawing on Odysseus heading home from Troy or Jason in the Argo, the Mediterranean Sea expanded to the vastness of the galaxies. Gulliver is there, too, cast each time into an insular world operating by entirely other rules.

Leonard Nimoy and Diana Muldaur in Star Trek (1966). Photograph: Allstar/PARAMOUNT

Roddenberry and his scriptwriters grasped the essential fact of American network TV – that it must grab and then hold its audience against the lure of other channels, and so every episode begins in urgency. Though the series was strong on plot, the plots were ultimately not the point. TV is for company, and the surrogate family of the Enterprise crew are one of the earliest and best versions of telly’s consoling friendliness. In the end we return to the show for the people, because of our connection to Kirk and Spock and the rest of them, the genuine solace of involvement with fabricated others. Doctor Who endorsed a peculiarly British eccentricity, as a drama centred on an individual with passing companions, while being (in its long first run, at least) remarkably chaste, its hero above the claims of the flesh. Star Trek offered instead the Americanised democracy of personality, the fusion of opposites in the crew, and a fondness for passing romance.

Despite Roddenberry’s best efforts, the sexual politics of the show remain rooted in the era of James Bond and Alfie. NBC’s executives reputedly scuppered an initial desire to present women in roles of authority (so Roddenberry has said; the executives themselves deny it). As the saga repeatedly reworked that archetypal sci-fi text The Tempest, Kirk was always eager to play Ferdinand to a succession of Mirandas. His boyish alacrity implies that, as we spread out into infinite space, one of the defining qualities of the human being remains flirtation. Hence all those stories in which baffled extraterrestrial maidens frowningly query: “What is this word, ‘kiss’?” Even the apparently asexual Spock finds himself driven by the “Pon Farr”, a mating call that makes him moodier than a bedroom-sequestered teenager, the instinctive life’s revenge on a cultural commitment to logic and reason.

Boldly going … the USS Enterprise-D. Photograph: BBC TWO

Star Trek’s appeal depends, of course, on another intimacy altogether, the balance between Kirk and Spock, itself a union of opposites and diverse acting styles. In some ways, the two actors were counterparts – Jewish in origin, both with Ukrainian blood, lower middle-class (Shatner) and working class (Nimoy), exactly of an age (they were both born in 1931). On screen, however, everything depends on difference. Shatner does the charisma bit, larger than life, the gusto turned up to 11. Meanwhile Nimoy faces him with his urbane, reflective stillness, someone observantly in abeyance. They’re as mythic a pair as Don Quixote and Sancho Panza, as Jeeves and Wooster, the sense and the sensibility of one complete person separated out into two characters.

Supposedly modelled on Horatio Hornblower, Kirk was an all-American hero, the college sports star dispensing justice for the universe. In the years of the Tet offensive in Vietnam, and the killing of the Kennedys and Martin Luther King, he embodied a largely unproblematic heroism. Initially, NBC wanted Spock out, saying the audience would never identify with a pointy-eared alien. Worse, he would, they imagined, scare away advertisers. In fact, of course, Spock became the great success of the show, a strangely comforting presence. The third wheel in this pivotal relationship is DeForest Kelley as Dr McCoy. Kelley was 10 years older than Nimoy and Shatner, his role often to state as irascibly as possible the moral burden faced by Kirk, a choleric, spluttering figure of conscience.

Nichelle Nichols as Uhura in A Piece of the Action. Photograph: CBS Photo Archive/CBS via Getty Images

In its later, mostly excellent versions, the series lost its central trio, but it never lost its fascination with the contiguous border between humanness and the alien, between the person and the beast or thing. In a show dedicated to the defining of the human, Spock engages us constantly with the other than human. Roddenberry envisaged him as a person at war with himself, torn by being both human and Vulcan. Spock occupies the border, both one and the other. Wonderfully, this boundary existence renders him the most empathetic person on the Enterprise. This creature of logic is also the man of the mind-meld, the one best able to inhabit and comprehend inconceivably different others – to enter into what is life, but not as we know it.

One of the very best stories, Devil in the Dark, features an encounter with a silicone-based creature dwelling in the tunnels of a far planet, and apparently an inexplicably murderous beast burning unsuspecting miners to a trace of smoke and ash. The story plays out as half hunt, half detective story, an exercise in the discovery of motive. Typically for the genre, the planet’s colonising miners miss the main clue (the silicone nodules down in the deep shafts that they have been carelessly destroying or discarding). Spock is the detective in the tale, ultimately discovering the reason for the beast’s killings by merging his consciousness with it. Elsewhere empathy works strangely. (Spock was always a descendant of Sherlock Holmes and in the 1970s, Nimoy would play the Baker Street detective in an RSC production.) In the excellent Balance of Terror, Kirk and the enemy captain of a Romulan ship read at a distance each other’s next moves, learning to understand the enemy; when they finally speak to each other, the Romulan tells Kirk that, given their similarities, in other circumstances they might have been friends.

A descendent of Sherlock Holmes … Spock in Amok Time (1967). Photograph: CBS Photo Archive/CBS via Getty Images

It is one of the strengths of Star Trek that it can imagine a technological futurity where whatever it is that makes us human not only survives, but flourishes. In Space Seed, Khan, a eugenically-engineered superman cryogenically frozen since the 1990s, declares, “I am surprised how little improvement there has been in human evolution. Oh, there has been technical advancement, but how little Man himself has changed!” Well, good. In The Ultimate Computer, Kirk faces the prospect of being replaced as captain by artificial intelligence. The future’s automated world looks set to lose its last human element. Only, of course, it doesn’t: the new supercomputer turns murderous; the human touch remains indispensable. Out there, in eternity, the human version of living stands as one of the richest, valuable in its capacity for imagination and spontaneity, gentleness and courage.

The great enemy to this indomitable spirit is not immensity itself, but persons swollen up to the size of the limitlessness they inhabit. Some fans groan over Roddenberry’s penchant for a fight with some “god-like being”. For me, this repetitive struggle between the Übermensch and the little people is really the central message of the show, which in the decade where Bilbo Baggins was a hero to the hippies, celebrated the weak and small’s ability to outwit the mighty. In the show’s second pilot, Where No Man Has Gone Before, the silvered, shining eyes of the evolutionarily-altered superhumans helps to preclude sympathy with them; the eyes here are closed over, the windows of the soul shuttered.

Star Trek’s brilliant optimism lay in imagining a future where the person still persisted. More than that, it established a vision of a universe full of possible variations in the concept of the person. The enormous interstellar spaces between the stars are not terrifyingly empty but vitally full; space means plenitude. Those endless distances contain myriad ways of being, creatures similarly capable of duties and responsibilities, engaged like us with others in a process of self-realisation.