In "Dagger of the Mind" the "Star Trek" crew explores the problems of penal systems and the moral questions they raise. A perfect facility by reputation comes under question as it crosses paths with the "Star Trek" Enterprise crew.
At the time this episode aired, there was a reexamination of what prisons systems should be. Punishment versus rehabilitation was a issue. Psychology experiments were indicating a desensitization of guards to prisoner suffering. along with these issues was a expansion of sciences view of the mind.
The latter was partly an off shoot of the drug culture, meditation, and other movements.
This episode examines what would happen if a prison system goes off mission. What if those in control could impose their thoughts on others? Captain Kirk once again find himself with the girl and a problem of planetary proportions. "Dagger of the Mind" is a fair episode that is an example of how "Star Trek" deals with social issues.