What happened was this. The creatures so referred to were invented along with the rest of Tolkien's subcreation during the writing of the Book of Lost Tales (the "pre-Silm"). His usage in the early writing is somewhat varied but the movement is away from "goblin" and towards "orc". It was part of a general trend away from the terminology of traditional folklore (he felt that the familiar words would call up the wrong associations in the readers' minds, since his creations were quite different in specific ways). For the same general reasons he began calling the Deep Elves "Noldor" rather than "Gnomes", and avoided "Faerie" altogether. (On the other hand, he was stuck with "Wizards", an "imperfect" translation of Istari ('the Wise'), "Elves", and "Dwarves"; he did say once that he would have preferred "dwarrow", which, so he said, was more historically and linguistically correct, if he'd thought of it in time ...)
In the Hobbit, which originally was unconnected with the Silm, he used the familiar term "goblin" for the benefit of modern readers. By the time of LotR, however, he'd decided that "goblin" wouldn't do -- Orcs were not storybook goblins (see above). (No doubt he also felt that "goblin", being Romance-derived, had no place in a work based so much on Anglo-Saxon and Northern traditions in general.) Thus, in LotR, the proper name of the race is "Orcs" (capital "O"), and that name is found in the index along with Ents, Men, etc., while "goblin" is not in the index at all. There are a handful of examples of "goblin" being used (always with a small "g") but it seems in these cases to be a kind of slang for Orcs.
Tolkien's explanation inside the story was that the "true" name of the creatures was Orc (an anglicised version of Sindarin Orch , pl. Yrch). As the "translator" of the ancient manuscripts, he "substituted" "Goblin" for "Orch" when he translated Bilbo's diary, but for The Red Book he reverted to a form of the ancient word.
[The actual source of the word "orc" is Beowulf: "orc-nass", translated as "death-corpses". It has nothing to do with cetaceans.]