Yeah, you could have a funky leak in the washer that is allowing the washer to ooze gunk into the tub - but most likely it is something in the washing/detergent process. Washer tubs are pretty self contained and from prior gasket breakage I know that they are outside the wash tub.
Try switching laundry detergent, don't use any softening additives for a cycle or two. Oh, and check pockets? My son leaves all kinds of things in his pants pockets - from pens to candy to money.
So in our house for laundry - I separate by color and clothing purpose. My work clothing gets laundered separately from my jeans and sweats, and whites get their own load, etc. Oh, and my son does his own laundry now so I don't check pockets as often.
I use only the gentle cycle and cold wash/rinse, and honestly, whatever detergent is on sale - this week's purchase was Target's store brand. I did just buy Purell softening crystals - they are new and I had a coupon - that just add to the wash water with the detergent - they smell fantastic!!!
For towels, dog blankets, and unusually funky stuff, I use about a 1/4 cup bleach, detergent, and hot wash/cold rinse. Still only the gentle cycle.
Try some of the ideas of "washing" the wash tub - I occasionally just run a cycle on hot without clothing to "flush" it out.
Good Luck and God Bless