Background: Life expectancy has increased in cystic fibrosis (CF) patients; however, the rate of mortality is still high, and in a majority of cases, the cause of death is due to respiratory deterioration. Vitamin D plays an important role in immunity and infection prophylaxis, as its deficiency is associated with frequent infections. In CF patients, a deficit of liposoluble vitamins is common, despite daily supplementation. The aim of this study is to evaluate the relation between vitamin D status and lung function expressed by lung clearance index (LCI) in patients with CF. We also assessed the relation of factors such as nutritional status, genotype, and associated comorbidities such as Pseudomonas infection, cystic fibrosis-related diabetes (CFRD), and cystic fibrosis liver disease (CFLD) with vitamin D and LCI. Methods: A cross-sectional study was conducted at the National Cystic Fibrosis Center by analyzing patients with CF who presented in our center between November 2017 and November 2019. We enrolled in the study patients diagnosed with CF, who were followed up in our CF center and who were able to perform lung function tests. Patients in exacerbation were excluded. Results: A strong negative correlation was found between vitamin D and LCI (r = −0.69, p = 0.000). A lower vitamin D storage was found in patients with CFLD and CFRD. Higher LCI values were found among patients with chronic Pseudomonas infection, with BMI under the 25th percentile, or with associated CFLD. Conclusion: In CF patients, vitamin D plays an important role, and its deficit correlates with an impaired LCI. Vitamin D deficit is a risk factor in patients with associated comorbidities such as CFLD and CFRD. Chronic infection with Pseudomonas, the presence of impaired nutritional status, and CFLD are associated with a prolonged LCI.