Historically, food wasn’t as abundant as it is today. Gluttony as a sin, at least with food, isn’t the same today as it was 200 years ago. That’s a ridiculous argument to make. If you really want to speak ‘historically’, it was advantageous for our hunter gatherer ancestors to exploit any opportunity for extra food because they never knew when the next meal would be. We’re still hardwired for that, except food isn’t rare anymore it’s abundant for most people on the planet.
Besides, food addiction isn’t the same as other additions, an alcoholic can obtain from drinking alcohol, an opioid addict can too, no one can stop eating food. Unlike other additions, someone who’s obese because of their eating habits can’t quit food. The thing their addicted to is in front of their face every day.