Considering food habits as a modifiable risk factor, an early intervention on youth people could avoid future health and social costs. We aim to determine the level of compliance with the recommendations of the Mediterranean diet pyramid according to social determinants in university students and to analyse the association of these social determinants (and their interaction with gender) with different food group consumption. We used the records of an electronic cross-sectional survey on university students (n = 593) from inland Spain. The results show, generally, that university students do not fully comply with the recommendations and that gender is the social determinant with the greatest effect on differences in food group consumption. Women have a lower consumption of dairy products, olives, nuts and seeds, red meat, and processed meat, sweets, eggs, alcoholic drinks and fast food; and a higher consumption of fruit, compared with men. Socioeconomic status, geographic area, and whether students cook for themselves have a limited influence on differences in food group consumption, which is inconsistent with the literature. Policy makers should consider this gender gap if they wish to implement a policy based on healthy diet, considering that other social determinants are also important, and could interact with gender.