I can imagine a show without a doctor. But in all the shows the doctor plays a big role.
I’m trying to think this back and McKoy was such a brilliant character I can see that starting the entire trend. I’m unsure if there was a trend in TV before that for a medical doctor. Anyone know?
If your premise has characters facing danger somewhat frequently, it makes sense to have someone who can heal around.
Also, with so many unknown space-originating ailments, it’s creepy to hear a doctor of high rank say “I don’t know what this is or how to fix it.” It adds to the stakes of the show.
Stories often have an author-as-character, where the writer(s) use a certain wise character to voice their own opinions.
TOS just merged these ideas into one character.