As others have mentioned, Dr. Who & Star Trek tend to be episodic with case of the week, adventure/monster/mystery of the week "built in", even though there is also serialization and/or bigger arcs with both shows and/or their later incarnations.
But with Black Mirror & The Twilight Zone one is dealing with new characters and settings in every episode and this kind of structuring is an episodic "anthology" series. (In Black Mirror's case, however, there is evidence to support the theory that all of the episodes exist in Black Mirror's universe(s), but indirectly).
However trying to answer your Q more precisely is hard, because you are under the assumption that the episodic structuring is a separate idea from say, the individualized idea of switching settings every week.
Advantages of the episodic style (From Author J.S. Morin)
Any series is going to have an overall theme or arc. What the episodic style
changes is the reliance of one installment on the previous. You can
jump in at nearly any point, and while you’ll lack the back story,
you’ll still be able to experience a good story. You wouldn’t read The
Two Towers without first reading Fellowship of the Ring, but you can
pick up Terry Pratchett’s Discworld novel anywhere you like. This lets
readers pick and choose the books that interest them, without having
to “get through” earlier volumes that may not be to their liking.
But again, case of the week, monster of the week, mystery or adventure of the week (with or without the same characters) are all about episodic structuring to keep things fresh, and because network TV in particular still tends to hold the belief that some kind of episodic structuring makes it more accessible for any given audience member to be able to jump into the series at any time. In other words one wouldn't need to change things up all the time (case, mystery, setting) unless one wanted to make it easier to jump into the story.
But other difference between Star Trek/Doctor Who vs Black Mirror/The Twilight Zone is often the idea that in serialized hybrid series, you are still more invested in the main characters over the long the haul and therefor those characters are not solely about serving the theme or plot alone, but rather sometimes those things work to establish whom they are and what they mean, as they are set up as ongoing protagonists, -- but in an episodic anthology series, one is usually (but not always) a bit less invested in the characters and more intrigued by the plot twists and fates of the characters, which IMO make it much more solely about theme, --often in the form of a cautionary tale that hurts the main character(s) and/or showcases serious repercussions with no way to get out of it. Star Trek & Doctor Who are both pro humanist stories showcasing mostly positive portrays of humanity being able to save themselves and/or make their realities a better place.