Because you're more likely to buy unhealthy food:
[T]he more nourished we are the more rational we tend to be. Similarly, our irrationalities increase the longer we go without food. This helps us explain our grocery store tendencies better: a hungry brain has a hard time focusing on the healthiest and cheapest options because doing so requires mental energy it doesn’t have. The opposite happens when we shop on a full stomach; a glucose rich brain has a much easier time seeing what is best.