Because the toilet sat still. With no flushing for a week or two, the bowl and tank become standing water, and drain flies and midges lay eggs in it. The larvae hatch while you are away. Flush several times, scrub under the rim and inside the tank, and they usually do not return.
A toilet in daily use replaces its bowl water many times a day, which gives eggs no time to hatch. Leave it for a week and three things happen together: the water goes stagnant, a film forms on the surface and under the rim, and insects that came in through vents or open windows find a place to breed. Drain fly larvae look small and dark. Midge larvae look red.
North Texas heat speeds this up. In July and August, a closed-up house can come back with larvae in any toilet that went unflushed. Traps under sinks and in floor drains also dry out during long absences, which lets sewer gas into the house.
Before a long trip, flush every toilet, run water into every drain, and close the toilet lids. If the worms keep coming back weeks after you return and every toilet is in regular use, the vacation is not the cause. Buildup in the drain line or a cracked pipe can keep feeding them, and that needs a camera.
Nuflow DFW is a licensed trenchless sewer contractor serving 25 Dallas-Fort Worth cities, RMP# 46694. A camera inspection finds buildup or damage below the toilet, and our drain cleaning clears it. You keep the footage. Call (469) 701-0597.