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 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.”
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.
And mostly I avoid prying about mental health, except to the extent the individual relationship makes the topic come up (e.g. if they mention it).
If it's impacting work performance, I can inquire in more open ended ways than that.