From a philosophical and perhaps for some a much too humble point of view..... Chickens aren't really as stupid as we egocentric humans wish to believe. Unfortunately for our human ego chickens have their own hard-wired culture still in them. They haven't died out in their much longer chicken/Earthly history or killed their environment as we have in our much shorter human/Earthly history.
As for spoiled food and chickens...I think we need to know the original chicken did not specialize in any particular source of nourishment. They were and still are an opportunist to the max when it comes to food.
I used to harvest deer, elk and other animals....a lot! I provided a good life for my fam and a lot of other people. As did many of my friends. It became a tradition that the harvest make it's way to my home grounds for processing. Chickens, like many(if not all) other birds, don't have much of a sense of taste although their sense of smell apparently is astounding. My chickens would make their way to the discarded "whatever" and chow down on a whole host of what we humans consider "EEEEWWWW GGRRROOOOOSSE!!!!!!. I eventually moved this "discard" across the ditch then even across the wetland/meadow. I decided against having "discard" anywhere close to my home because the chickens started getting picked off by all kinds of predators, avian and terrestrial, as they found their way across a 1/3 mile of unfenced practical wilderness to the smell of feast which included EEEEEWWWWW! maggots.
All this eeww factor seemed to have no ill effect on the eggs or the flesh of my birds. If anything it appeared to inflect a lot of "un-EEWW" flavor/s, some beautifully subtle.
And of course because of the swamp/wetlands next to my place there are a lot of frogs, snakes, Stickleback, all kinds of bugs and nymphs of such, snails , etc.etc..
My Pampa and Nana used to feed their chickens raw fish and raw rabbit. Not as a staple....LOL. It didn't affect the taste of the eggs or the roasted or fried or boiled for soup or stew chicken meat either. Well....maybe a bit of a taste if we "overfed".