Caffeine is a virtuous stimulant. That is to say, utilizing the stimulating properties of coffee, tea, and other caffeine-bearing beverages for personal and professional use is socially acceptable, and often encouraged, in societies worldwide.
Expounding on the earlier thought concerning the Aristotelian characterization of virtue as moderation, it seems apropos to conclude that it is virtuous for one to consume caffeine because it yields a moderate amount of stimulation. Caffeine stimulates you enough to have a quickly noticeable impact on attention, activity, and productivity. But not too much, and not for too long.
Contrast caffeinated drinks with the more effective stimulants that pervade modern society, including illicit drugs like methamphetamine. Meth does a better job at stimulating your CNS and makes you far more active than caffeine does, but it's too much too fast, ultimately yielding a very unpleasant and unproductive comedown. Its short-acting and addictive nature make it prone to abuse and withdrawal cycles, leading to socially undesirable addicts. Social pressure begets law, so it is illegal for an individual to independently obtain or use powerful drugs like amphetamines.
Caffeine is addictive and like other "uppers" also has comedown and withdrawal symptoms that lead to unsociable characteristics, but not to the extent that the disadvantages outweigh the advantages. In other words, the gain in productivity during stimulation is widely considered valuable, and any subsequent drops in productivity are not severe enough to warrant imposed restriction.
By virtue of its moderate effect on human physiology, caffeine is culturally pervasive. It is attainable in roughly standardized doses, hence descriptive phrases like "about as much caffeine as in a cup of coffee". As you drink a cup of coffee the effects of the caffeine come timely, not immediately or overpoweringly. The caffeine is diluted in a mostly water solution, so intake is paced to a rate of drink that helps to self-limit unintentional over-consumption. More important, the stimulating effects are of manageable duration and intensity. Someone who downs too many shots of espresso might feel restless, hyperactive, or "on edge", but the effects are not wholly debilitating and conveniently fade in about a day's time. It's relatively easy to adjust and find a sustainable number of "cups per day" that provide moderate stimulation, of moderate duration, at appropriate times. For many people in western society that means a cup of coffee or tea each morning before beginning earnest work.
The virtue of coffee emerges from its cultivated moderation. Cultures worldwide have been utilizing stimulating plant life for thousands of years, creating and settling on balanced drinks like coffee and tea to propagate a moderated norm for optimal societal augmentation.