Was it unsolicited? If the poster confided to his boss that he has focus issues, his boss might have just been trying to offer a solution (albeit a bad one). I don't see what's unethical about this.
It’s still not appropriate for a manager who is not acting in a medical capacity to make that kind of recommendation.
It’s a huge huge leap to go from “I feel like your focus needs improvement” to “go get an amphetamine prescription because I feel you are not working hard enough.”
I agree that it's inappropriate, but it seems like an equally huge leap to go from that to "your days are numbered" when we don't have any other context.
Of course our reactions are heavily biased towards our personal experiences. If my manager said something like that to me I'd laugh it off as a bad joke or a poorly executed gesture with good intentions.
He could offer many solutions to a problem with focus, headphones, flexible working hours/location, ect but not medication. He is not a doctor and knows nothing about his employee's medication history.
It’s a huge huge leap to go from “I feel like your focus needs improvement” to “go get an amphetamine prescription because I feel you are not working hard enough.”