Humorous pseudo-Latinism, from noli (“do not permit”) and illegitimi (“bastards”) and from the Latinate brand name Carborundum for a silicon carbide abrasive.
The phrase is similar to the real Latin phrase nil desperandum (“do not despair”, literally “nothing to be despaired of”), which would be known to many English speakers. The -rundum ending of carborundum recalls the word desperandum, although such a gerundive suffix makes no sense for this phrase.
This form of the saying was popularized in English by the US general "Vinegar Joe" Stilwell during World War II, reputed to have been taught it by British army intelligence. It later became the motto for the 1964 Republican presidential nominee Barry Goldwater, who displayed it as a sign in his senatorial office. The plural form nolite te bastardes carborundum was popularized by Margaret Atwood's 1985 dystopian novel The Handmaid's Tale and its subsequent TV adaptation.