The Magicks of Megas-Tu (TAS)
I'd never made it a point to hunt this down and watch it just based on the description, and even reading ADF's adaptation years ago didn't do anything for me, but watching this episode last night I was really, actually moved.
Humanity being put on trial seems to be a favorite schtick of Roddenberry, as is dealing with questions of God, so maybe it was the animated format, where you're not really expecting much but then it hits you out of the blue. Mankind has been a savage race, hateful and hurtful, but we're getting better. Kirk's sympathy for the devil (natch!) is probably now one my absolute Trek high points.
The preceding should be read with the understanding that I had also been drinking when I watched the episode.