I was watching a 1960s episode of Star Trek and the ship computer had a robot voice. I also think Lost in Space had a robot voice. When and how did the concept of robot voice enter the public consciousness?
Note- my interest is more on the musical side of things, but I think I can take a stab at answering this:
When you say "Robot voice", you're referring more of a sound that has become attached to robots, not necessarily what robots would sound like.
So the "robot voice" is basically an electronically generated sound that has mechanized sounding inflection and phrasing. This can be done by either taking a human voice and turning it into an electronic sound, or by synthesizing the voice from scratch.
In the first case, the technology dates back to Bell labs from the 1930s. Technicians were working for a way to send voice conversations via the phone with less bandwith and more multiplexing. What they came up with was called a vocoder.
The way a vocoder works is to break down the sound of the human voice into bands of frequencies, identify the key points of that frequency (start of sound, stop of sound, volume, etc). They would then take that information and apply it to a synthesized sound with the same logic. After this, those different frequencies of sounds would be mixed together to reproduce the human voice. This sounds very complicated in a "how could this possibly work?!" sort of way, but if you tune the frequencies and analysis properly, you can actually recreate understandable speech.
As you can imagine, no one would confuse the output of a vocoder with actual speech. But it had it's uses in the growing telecoms industry. Vocoder type technology is very much in use today, in that actual "sound" is not transmitted via your cellphone, but it's converted to an electronic signal, and then reconverted back to the sound heard on the other end. Since the technology for this has improved quite a bit in the last 80 years, it has become impossible to distinguish normal speech from "electronically generated" speech
Now- moving on to the 50s+60s. This is when the rise started of tv and movie based sci fi/space themes. People creating these shows wanted to move beyond regular orchestration to "futuristic/otherworldly sounds". In this case, the vocoder with it's synthesized output became an easy way to create robot voices (among other technologies).
One of the key points here was the BBC Radiophonic workshop, which was a department of the BBC tasked with creating sounds/noises/effects for the various BBC programs. Where it was groundbreaking was that it was the first majorly funded department that had access to cutting edge (of the time) sound synthesis technology. Not only that, but they also were funding engineers to create new synthesizers and other technology to gain new tools, and also support artists who wanted to use those tools.
As you can imagine, these sounds were very unique and novel to audiences not familiar with electronically generated sound in general. It definitely joined in with the growing interest in the space race in bringing an otherworldly and futuristic feeling to what they were watching.