This is a type of mucus that can accumulate in the bowel during infections. It is much like the way the lungs work to remove infections, but this type of mucus is very thick and can be rubbery after time.
My opinion is this could have been a C. Difficile, or other serious bacterial infection. Fungal infection is not ruled out, but I would guess there would be skin, hair, and nail infections involved, since fungi generally gravitate to keratin.
Other parasites could also cause this type of thing, but my impression leans more to bacterial infection.