Ĥametz that was originally fit for eating, but that became moldy or spoiled to the point that it is not fit for human consumption, is still considered ĥametz gamur, since it can still be used as a leavening agent. In other words, even though, in general, all forbidden foods become no longer forbidden once they are no longer fit for human consumption, ĥametz is different. Since it can still help in the preparation of food, it is like se’or, which serves as a leavening agent and is therefore considered ĥametz. However, if it became so spoiled that it is not fit for consumption by a dog, then it is not considered food at all. Therefore, the law of ĥametz does not apply to it and it is permissible to keep it during Pesaĥ and to gain benefit from it (SA 442:2; MB ad loc. 10). By rabbinic decree, however, it is still forbidden to eat it on its own, for one who eats it – even though he is doing something very unusual – demonstrates that he still considers this ĥametz to be food (MB 442, 43).
The yardstick of being fit for a dog’s consumption is relevant only for measuring the spoilage of ĥametz or se’or. But if se’or was not spoiled, but only became so sour that it is not fit even for a dog, since it is good se’or (that functions as a leavening agent and is usable like regular yeast), all the laws of ĥametz apply to it, and one is required by Torah law to destroy it (BHL 442:9).
This law – that one does not have to burn ĥametz that was spoiled to the point of not being fit for a dog’s consumption – applies only if it became spoiled before the time that ĥametz becomes prohibited. But if it was fit to be eaten by a dog when the prohibition of ĥametz began, then even if it became spoiled later, to the point of not being fit for a dog’s consumption, one must burn it. Once the mitzva of eliminating the ĥametz is in effect, one does not discharge his obligation until he has destroyed the ĥametz completely (MB 442:9; see below, ch. 5, n. 5).
Note that all of these laws are conditional on the ĥametz having initially been fit for human consumption, or for preparing food for humans as se’or. If, however, it was not fit for human consumption at all from the beginning, then even if it was fit to be eaten by a dog, no prohibition applies to it. If from the beginning it was not intended for consumption, but it was in fact barely fit for human consumption, then it is ĥametz nuksheh, as described above.