The episode is "The Obsolete Man." It was broadcast on "The Twilight Zone" June 2, 1962.
In a future totalitarian state, Romney Wordsworth (Burgess Meredith) is a man put on trial for the crime of being "obsolete". His occupation as a librarian is a crime punishable by death, as the State has eliminated literacy. He also believes in God, also punishable by death, as the State has declared that there are no Gods. He is prosecuted by the Chancellor (Fritz Weaver), who announces in front of the assembled court that Wordsworth, in not being an asset to the State, shall be liquidated.
After being convicted, Wordsworth is allowed to choose his method of execution. He cryptically requests that he be granted a personal assassin to whom he may privately disclose his preferred method of execution. He also requests that his execution be televised. Both requests are granted by the court.
We have always had ways to, shall we say, assign humans. Thoughts, faiths, beliefs, all controlled not by a government, but by society's unprinted rule. Ther are many ways that it is done, by suspicion ("Are you conservative/liberal/black/white/Christian enough?"), the leading question, the assumption that you must be A in order to be B. And when subtlety does not work, the time honoured methods of shunning, the boycott, ridicule. Then imprisonment. And when all else fails, death.
This story is a cautioionary one. Imagine what may happen if a small number of people truly wanted to go their own path, and not the path of the mob. We are coming dangerously close to that mob rule when, if your thoughts, action, life, faith do not meet specifics, death would be the only remedy. And, as the tale above shows, some who advocate that may very well become its victims.
It has been said that those who do not learn from history are bound to repeat it. It is my sad duty to report that not only are we on the way to repetition, we may add to it. Live, in living color. And in high-definition.