The importance of a sustainable diet is an emerging concept within sustainable food systems. Food systems emit 30% of greenhouse gases, which needs to change. A cross-sectional study was carried out to determine the knowledge, attitudes, and habits of students and professionals in the health sciences regarding a sustainable diet, comparing these to the Spanish population. We further aimed to analyse the consistency between the knowledge and attitudes of these individuals and their dietary habits and analyse the consumption of different food groups that are typical of a sustainable diet. A survey was completed by a total of 415 participants, both university students in the health sciences and health professionals. These two groups were more knowledgeable of sustainable diets than the general population, although certain concepts are unfamiliar to both populations. A positive attitude towards sustainable food habits was also observed among the population studied. The health sector reported having better eating habits than the overall population. A significant positive correlation was observed between higher fruit and vegetable consumption and deeper knowledge and more favourable attitudes. People with less knowledge and worse attitudes reported consuming more red and processed meat. The findings of this study could inform targeted interventions for health professionals given the need to promote a healthy diet but also a healthy and sustainable diet for planetary health.