Yeah, I remember this:
The Lost Star Trek Christmas Episode: “A Most Illogical Holiday” (1968)
Mr. Spock, with his pointy ears, is hailed as a messiah on a wintry world where elves toil for a mysterious master, revealed to be Santa just prior to the first commercial break. Santa, enraged, kills Ensign Jones and attacks the Enterprise in his sleigh.
As Scotty works to keep the power flowing to the shields, Kirk and Bones infiltrate Santa’s headquarters. With the help of the comely and lonely Mrs. Claus, Kirk is led to the heart of the workshop, where he learns the truth: Santa is himself a pawn to a master computer, whose initial program is based on an ancient book of children’s Christmas tales. Kirk engages the master computer in a battle of wits, demanding the computer explain how it is physically possible for Santa to deliver gifts to all the children in the universe in a single night. The master computer, confronted with this computational anomaly, self-destructs; Santa, freed from mental enslavement, releases the elves and begins a new, democratic society. Back on the ship, Bones and Spock bicker about the meaning of Christmas, an argument which ends when Scotty appears on the bridge with egg nog made with Romulan Ale.
Filmed during the series’ run, this episode was never shown on network television and was offered in syndication only once, in 1975. Star Trek fans hint the episode was later personally destroyed by Gene Roddenberry. Rumor suggests Harlan Ellison may have written the original script; asked about the episode at 1978’s IgunaCon II science fiction convention, however, Ellison described the episode as “a quiescently glistening cherem of pus.”
Whatever: The 10 Least Successful Holiday Specials of All Time