Prior research has shown that participation in the United States’ National School Lunch Program (NSLP) is associated with consuming higher-quality lunches and diets overall, but little is known about differences by income and race/ethnicity. This analysis used 24 h dietary recall data from the School Nutrition and Meal Cost Study to examine how NSLP participation affects the diet quality of students in different income and racial/ethnic subgroups. Diet quality at lunch and over 24 h was assessed using the Healthy Eating Index (HEI)-2010, where higher scores indicate higher-quality intakes. HEI-2010 scores for NSLP participants and nonparticipants in each subgroup were estimated, and two-tailed t-tests were conducted to determine whether participant–nonparticipant differences in scores within each subgroup were statistically significant. NSLP participants’ lunches received significantly higher total HEI-2010 scores than those of nonparticipants for lower-income, higher-income, non-Hispanic White, and non-Hispanic Black students, suggesting that participating in the NSLP helps most students consume healthier lunches. These significantly higher total scores for participants’ lunch intakes persisted over 24 h for higher-income students and non-Hispanic White students but not for lower-income students or students of other races/ethnicities. For NSLP participants in all subgroups, the nutritional quality of their 24 h intakes was much lower than at lunch, suggesting that the positive influence of the NSLP on their overall diet quality was negatively influenced by foods consumed the rest of the day (outside of lunch).