As a former state correctional officer, I can tell you that in state prison systems nurses or other medical staff, not correctional officers, dispense medication to inmates.
Dr. Thomas Szasz's positions were more nuanced than many people believe today when they criticize his writings, particularly the book The Myth of Mental Illness. He noted that much that was labeled "mental illness" was actually people getting away with behavior that got them things, such as attention, sympathy, money, etc.
He didn't quite phrase it this way, but he certainly would have agreed with my observation: notice that people who "hear voices" never hear the voices telling them to do good things. No, it's always bad things. They don't say, "Help your neighbor," but instead, "Hurt your neighbor." That should tell you that many of the claims of mental illness are a crock. It's people seeking excuses for bad behavior. We already have places for those who behave badly, namely prisons. We're just too afraid to use them for this group.