Habitual attachment to an unnecessary pleasure creates mental turmoil (and sometimes unpleasant bodily sensations as well, aka withdrawal symptoms).
Coffee...since it is easy to get and make at home, and just one-and-a-half cups a day in the morning feels like it creates mental sharpness for me. The caffeine addiction doesn't cause any mental turmoil.
So it is really depends on whether or not there are any bad consequences, and whether or not it is easy to get (and not expensive so that it does not deplete one's funds).