It's true, scientific research is demanding work, at least on the mental muscles that give patience and persistence, but I think there's more to the institutional coffee jones than simply energy demand: I would go so far as to say that coffee, which may or may not be reduced to caffeine for this purpose, actively conditions the mind for scientific thought. I would not go so far as to say that science can't happen without coffee, but rather that coffee helps people who need to think scientifically do so. One almost never hears, after all, of scientists running on speed or cocaine, even though these are arguably more effective in terms of providing "psychic energy." Certainly there are good reasons why illegal drug use might exist but not be known about among scientists, but my point here is that there really aren't even many stories about this happening, whereas in other professions like trucking and the music industry at least there are persistent rumors. Culturally, various drugs are stereotyped with various professions, and for the profession of science, the drug is coffee. I don't have any good evidence to back up my hunch that coffee causes people to think scientifically, of course--just anecdote, mostly, and a set of interesting historical correlations.
Coffee, like science, comes to us from the Arab world. Coffee plants are native to the highlands of Ethiopa, and evidence of their use in Africa as stimulants dates to the 9th century CE. Italians brought the beverage across the Mediterranean in the 16th century, and it was in this same place and time (1543) that Nicolaus Copernicus published De Revolutionibus, and, by the standards of most historians of science, began the modern scientific revolution. Galileo Galilei, another Italian and a man known as "the father of modern science," appeared in 1564. From Italy, both coffee and the line of "first greats" in science migrate to England. The first English coffee shop opened at Oxford in 1652; Newton published his Principia in 1687. In fact, if we order the major European nations of the time by the opening dates of their first coffee shops, we get Italy (1645), England (1652), France (1672), and Germany (1721).
Further, if we plot the milestones of science as an arrow in space and time across the face of Europe, we find the same general ordering. Certainly there are deviations, and even if a statistically valid correlation could be proven it would still be insufficient to claim causality: It may be just as likely that thinking about science makes people want to drink coffee as the reverse, or there may be outside socioeconomic factors driving both phenomena.
In other words, my thinking on this matter is really not very scientific.
Think I'll go get another cup.