Regarding small speaking parts that aren't billed, an actor can ask not to be billed, especially if that actor doesn't want that on their resume. And Star Trek might have been the kind of show someone didn't want to admit working on, at the time.
Not the kind of show? It was nominated for Emmys every year it was on the air. It was the number one reason people were buying color television sets in 1967. Critical reaction may have been mixed and its ratings may never have been great, but I think it was seen as a pretty prestigious show compared to other SFTV of the day.
Besides, the only people who might choose to go uncredited for the reason you state are people with enough prominence and reputation to be damaged in the first place. Yet all the big-name actors who appeared on ST did get credited. The few uncredited actors are bit players, people who would've needed all the screen credits and publicity they could get in order to advance their careers. I can't see people like that refusing credit for anything less embarrassing than a porn film. (Yes, Judson Scott went uncredited in TWOK, but I gather that was due more to his agent's bad judgment than his. I guess it's possible some actors or their agents could make such a decision, but it would be a pretty bad decision.)