OP's take on this resonated with me deeply. Throughout my life I've held the belief that, "I generally choose the right path." That's helped me in five decades of life to never be overweight, never smoke cigarettes, never do an illicit drug, etc. Your take on this topic does not come across as helpful or beneficial to me:
First, in the moment, be conscious of what the risks are, and if they are worth it. If they aren't, take pride in settling for less at the moment so you can safeguard your future.
I think it's important to forgive ourselves when we don't choose the right path. Shame isn't good for anyone. But to take pride in it? I don't believe that's helpful at all.
Calling those meals "failures" now would be saying that it was a mistake to enjoy that time with my family and friends
This really sounds like a rationalization. You could enjoy a healthful meal with family and friends. But you're likely addicted to sugar, fat and salt like most people are. So you need a bunch of sugar, fat and salt to be satisfied by a meal.
A decade ago I had slightly high triglycerides. I stopped all obvious sugar cold turkey for a year. It was brutal for two weeks - craving soda and all kinds of other sugar. Then an amazing thing happened... I stopped craving sugar. Fruit and other food started to taste amazing! Imagine getting as excited about eating a clementine as you used to get eating chocolate cheesecake.
I reframed the topic in my mind to, "I just don't eat those things." which was successful. Thoughts of, "I won't eat those things for the next two weeks and then I'll do what I want" just exhausts your will power and leads to a roller coaster of weight gain and loss.