Source: Pool, E., Brosch, T., Delplanque, S., & Sander, D. (2015). Stress increase cue-triggered "wanting" for sweet reward in humans. Journal of Experimental Psychology: Animal Learning and Cognition, 41(2), 128-136.
Stress can increase reward pursuits: This has traditionally been seen as an attempt to relieve negative affect through the hedonic properties of a reward. However, reward pursuit is not always proportional to the pleasure experienced, because reward processing involves distinct components, including the motivation to obtain a reward (i.e., wanting) and the hedonic pleasure during the reward consumption (i.e., liking). [...] Results showed that compared with participants in the stress-free condition, those in the stress condition mobilized more effort in instrumental action when the reward-associated cue was displayed, even though they did not report the reward as being more pleasurable.
What it means: when you're stressed out, there's more of a desire to "get" something that you like (i.e. shopping, food, drugs, TV shows, etc.), even if by the time you get it, it doesn't seem any more pleasurable than usual. Rather than admonishing yourself for this natural response, or fighting against its mechanism, it may be helpful getting your brain to associate certain "healthy" (or preferred) things as rewards (perhaps through repeated pairing of these things with successful completion of a task) in case you feel the need to indulge. It'd require much less energy in the long run to use a system already in place to your advantage.