Poor sleep quality, a global public health concern, poses a significant burden on individuals, particularly health care university students facing intense academic stress. A three-center cross-sectional study was conducted at the Higher Institute of Nursing and Health Sciences in Tetouan (Morocco), Faculty of Medicine in Tangier (Morocco) and Faculty of Nursing in Valencia (Spain). We collected various data using a sociodemographic questionnaire, the Pittsburgh sleep quality questionnaire, the international physical activity questionnaire (IPAQ) and the smartphone addiction questionnaire short-version (SAS-SV). A total of 1210 students were included in our study (mean age 20.4 years, 67.2% female, nursing students (66.2%) and medical students (33.8%), 76.1% students from Morocco and 33.9% from Spain). Analysis revealed a higher prevalence of poor sleep quality among Moroccans students compared to Spanish ones (p < 0.001), that nursing students showed less favorable sleep quality than medical students (p < 0.011) and that living with a chronic disease was linked to less favorable sleep quality (p < 0.001). Lastly, intense or weak physical activity and smartphone addiction were correlated with poor sleep quality (p < 0.001). In the multivariate analysis, an association persisted between poor sleep quality and factors such as the country of study (Odds ratio (OR): 6.25 [95% Confidence Interval (CI): 4.34–9.09]), involvement in nursing studies (OR: 3.50 [95% CI: 2.36–5.27]), and the presence of chronic diseases (OR: 2.70 [95% CI: 1.72–4.16]), (p < 0.01 each). Our findings highlight the multifaceted factors affecting sleep quality in young university students. The implications underscore the imperative of interventions tailored to this demographic group.