Hurley was probably thinking that, not only is he on the Island in the first place but is now with the two craziest guys about, he could meet his end at near enough any minute, so if there's some food going spare why turn it down...he's more likely to be killed off in other ways other than very out of date food
Good old selfless Locke, giving the crackers to Hurley and not even thinking of himself!