Vitamin D deficiency (VDD) and erectile dysfunction (ED) heavily burden the male population. The higher prevalence of both conditions in the elderly suggests a possible relationship between the two conditions. In addition, in vitro, animal, and human studies have revealed several mechanisms that may relate VDD to ED. The main mechanism by which vitamin D might exert its action on sexual function appears to be through the regulation of endothelial function. Indeed, VDD correlates with several markers of endothelial function. The action of vitamin D on the endothelium would be exercised both indirectly through its intervention in inflammatory processes and through the production of oxygen free radicals, and directly through the regulation of vascular stiffness, the production of nitric oxide, and the regulation of vessel permeability. Furthermore, the ubiquitous distribution of the vitamin D receptor in the human body means that this hormone can also exert a beneficial effect on erectile function by interfering with those comorbidities significantly associated with ED, such as hypertension, diabetes mellitus, hypercholesterolemia, chronic kidney disease, and hypogonadism. In this review, we thoroughly and carefully presented the evidence and mechanisms that would appear to relate vitamin D levels to erectile function. Furthermore, we have summarized the meta-analytic evidence for and against this association to provide a true representation of this topic. Data published to date suggest that low levels of vitamin D could contribute to worsening erectile function through several mechanisms. Therefore, vitamin D levels should be measured in patients with ED and maintained at adequate levels by specific supplementation in case of deficiency. However, the low quality and heterogeneity of clinical trials evaluating the effects of vitamin D administration on erectile function and ED-associated comorbidities do not allow for a univocal conclusion, and indicate the need for further studies to analyze these aspects.