A federal district court ruled that the USDA exceeded its legal authority when it approved five state waivers barring participants from buying foods such as candy and soda through the food assistance program.