John Stuart Mill said this quote
“ Whoever fails in the consideration generally due to the interests and feelings of others, not being compelled by some more imperative duty, or justified by allowable self-preference, is a subject of moral disapprobation for that failure, but not for the cause of it, nor for the errors, merely personal to himself, which may have remotely led to it. In like manner, when a person disables himself, by conduct purely self-regarding, from the performance of some definite duty incumbent on him to the public, he is guilty of a social offence. No person ought to be punished simply for being drunk; but a soldier or a policeman should be punished for being drunk on duty. ”