In order to prevent bacteria in the solid waste from producing gas, which could rupture the storage bags, a germicide was added to the bag after use and "kneaded in" to mix it with the waste once the bag was sealed. The germicide would kill the bacteria and render the potential poo-bomb inert.
I haven't seen this germicide referred to as a "pill" previously, but rather as a "pouch"; I think it's the packet of greenish-black material in this photo:

However, the caption of the photo in the context I found it refers to a "tablet" which is nowhere to be seen.
The most authoritative reference I found was Apollo Experience Report: Crew Provisions and Equipment Subsystem:
To use the FCA, the crewman attaches the outer fecal bag properly and proceeds with fecal elimination. Upon completion of the action and subsequent sanitary cleansing, the tissues and refuse are placed in the inner fecal/emesis bag. The crewman then removes the germicide pouch, cuts the outer protective seal, and places it in the inner bag. Finally, all items are placed into the outer fecal bag, the bag is sealed, the germicide pouch is ruptured by hand pressure, the bag is kneaded, and the contents are
stowed in the waste-stowage compartment.
Nice of them to give the astronauts an outer bag so they wouldn't have to watch the kneading process.
The report goes on to explain that this is the worst solution available to the solid waste problem, except for all the others:
Although the Apollo fecal-collection system is the same as that used in the Gemini Program, many new concepts and designs were investigated and tested. Various types of canisters, with and without air blowers, were developed with some success. In all cases, the primary problem has been the separation, in a weightless environment, of the fecal wastes from the crewmen. Nothing has proved more effective than the current system, which has proved adequate for all flights, although the crewmen have expressed dislike for it.
I do see references to germicidal tablets to be added to empty food packets after a crewman is done eating, for similar reasons, in Apollo Experience Report: Food Systems. I assume Walter Cunningham just conflated the germicidal pouches and tablets in his memory, 50 years after his flight.