We examined the association of the dietary habits and the Mediterranean diet (MD) adherence with sleep quality during pregnancy. A food frequency questionnaire and the Mediterranean Food Pattern were employed to assess dietary habits and MD adherence, respectively. Sleep quality was assessed with the Pittsburgh Sleep Quality Index (PSQI) global score (n = 150; mean age 32.9 ± 4.6 years). A higher consumption of fruits was associated with better sleep quality at the 16th gestational week (g.w.; p < 0.05). A greater olive oil consumption and a higher MD adherence were associated with better sleep quality at the 16th and 34th g.w. (all, p < 0.05). Contrarily, a higher red meat and subproducts consumption was associated with worse sleep quality at the 34th g.w. (p < 0.05). The group with the highest adherence to the MD (Tertile 3) showed better sleep quality than the group with the lowest adherence (Tertile 1) at the 16th and 34th g.w. (both, p < 0.05). A higher adherence to the MD, a greater intake of fruits and olive oil and a lower intake of red meat and subproducts were associated with better sleep quality along the pregnancy course, especially among sedentary women.