It seems like it was killing so many people, they would have had some theories about what it was.
Scurvy is actually a useful lens through which to view the transformation of medical understandings of the body, from the ancient-medieval humoral system to the biochemical system we have today.
According to the humoral system, articulated by Galen, among other ancient and medieval medical writers, the body operated with four fluids: blood, phlegm, yellow bile, and black bile. These four fluids corresponded to the four elements (earth, air, fire, water), and each humor paired two of the four sensations (hot, wet, dry, cold); each also corresponded to one of the four seasons. So, for example, blood was associated with the air and springtime, and it was warm and moist; phlegm was connected to water and wintertime, and it was cold and moist. Each individual had a particular mix of these fluids, which determined your temperament, so that if black bile dominated, you'd be melancholic; if phlegm dominated, you'd be phlegmatic.
Disease, in this system, resulted from imbalances, either in one's own fluids or, more broadly, in a body's relationship to its environment which could itself generate imbalances in the humors. The Hippocratic tract Airs, Waters, Places, for example, attributed disease to one's environmental conditions, though it would manifest in humoral imbalances. It also placed food into the same humoral categories, so that health and nutrition were closely linked in humoral medicine, and no diet was universally good; instead, one should eat the foods that suited one's own temperament.
This humoral-environmental view was the dominant mode through which to explain disease through the early modern period, and it remained a widely used frame of reference well into the nineteenth century. At a practical level, it held that if someone was sick, they were very likely in an unhealthy place. For physicians looking at scurvy, then, the thing that naturally came to mind was that the ship itself was unhealthy, and that the places where the men slept were dirty and poorly ventilated. This was probably a decent observation, as it is easy to image the fo'c'sles in which the men slept being damp, smelly spaces, and maritime medicine often focused on keeping the men's spaces clean and ventilated, and making sure that the men got fresh air.
By the seventeenth and eighteenth centuries, there certainly were doctors who were claiming that scurvy was linked to diet. It is important to recognize, however, that the idea of micronutrients and their deficiency was difficult for them to imagine until quite late in the nineteenth century. Vitamins were not definitely identified until the early twentieth century (Casimir Funk coined the term from "vital amines" in 1912, but their existence and importance was not fully accepted even into the 1930s). For that to happen, there had to be a serious shift in the way that bodies were imagined. This was the development, over the course of the nineteenth century, of a biochemical view of human bodies. With the identification of chemical elements oxygen, carbon, hydrogen, and nitrogen in the "chemical revolution" in the late eighteenth century, doctors had a new language with which to describe and investigate the operation of the human body. They began to imagine human bodies as operating according to a set of universal, chemical principles; bodies became machines running on chemical reactions. An important figure in this was Justus von Liebig, who, in the 1840s, described food in chemical terms, and identified nitrogen as the most important nutrient. For several decades, doctors thought about food basically in terms of how much nitrogen it provided. The body, to them, was basically a machine that consumed nitrogen through food, and oxygen through breath.
Biochemistry did not immediately obviate humoral ideas, however, and you can see the two coexisting in nineteenth century medical writing. Doctors like James Lind, who, in the eighteenth century, had identified citrus as an effective preventative and treatment of scurvy, had no real way to explain their observation that scorbutic sailors given lemons got better; in the context of humoral medicine and early biochemical nutrition, it was essentially impossible to imagine that some substance in tiny amounts could have such a huge impact on health. As such, while many nineteenth century doctors continued to argue that scurvy was caused by impure air, others suggested it was a nitrogen deficiency. Only in the later nineteenth century, when doctors and chemists were getting more sophisticated in their analysis of foods, could they begin to identify other substances in foods, what we would call micronutrients. I don't believe vitamin C itself was definitively identified until the 1930s. Still, by the middle of the nineteenth century, it was widely recognized that citrus did in fact prevent and treat scurvy, and so citrus became common on ships.
The standard history of scurvy is Kenneth Carpenter's Scurvy and Vitamin C.