A crime is a crime.
However punishments should fit them. If he is starving turn him out with a slap on the wrist. If he insists, send him to where he has no risk of starvation with a warm bed and a nice work detail.
So I agree in principle that a starving person can take food if he or his family are otherwise going hungry, AND if he has no other lawful options.
I do feel sorry for the poor man. I've worked with homeless people and they are so often addled and ill, or even quite mentally incapacitated. But it sounds like this was not the case with the bread&sausage man. He would've been better off if he'd been jailed... As you yourself mentioned. Three hots and a cot.