Gurgles in a toilet drain, sink drain or tub drain is air escaping the pipes. If the toilet is gurgling when washing clothes, the washing machine is forcing air back along the pipe to the nearest access point. Blocking the toilet drain would force that air out the next available drain. You have several explanations as to the cause and repair of the noise.
A partial clog in the main drain located after the washing machine fills will cause the gurgle. When the washing machine drains the water, the path is restricted, forcing water and air back along the length of the pipe. A partial clog will allow the water to flow past but at such a rate that backflow still occurs. Most sink and tub drains will not be readily impacted due to the slowness of those drains. The tub, being a large drain opening, allows the water and trapped air to force its way through the pipes to the drain opening, causing the gurgling sound.
Clogged Vent Pipe
The vent pipe is a vertical pipe that penetrates the roof. Most vent pipes are not covered by anything, allowing animals and natural debris to fall into the opening. When the pipe becomes clogged, air in the pipes has very few escape routes. The airflow is necessary to allow the water to properly drain. Tubs and sinks use very little in the way of pressure, so airflow is not as necessary for those pipes. The toilet and forced drains, like a dishwasher or clothes washer, require the airflow. A clogged vent pipe forces the air back out of the drain in the nearest opening, which is often a toilet drain. The gurgle is the sound of the air escaping the pipes.
Most professionals can ream out the clog using a plumber's snake or air bladder. The snake and bladder will force any clogs in the drain into the larger main drain, opening the flow of water. The plumber's snake is a tool that can be purchased at most hardware stores, allowing you to remove the clog without professional intervention. Use the snake on the drains and the vent pipe to remove any type of clog. Chemical drain openers also work wonders on slow drains. Pour the drain opener down the toilet following instructions included on the label of the chemical. Both professional and DIY clog removal will clear up the pipes and remove the gurgle.
Protect the Drains
Installing a vent pipe cap on top of the vent pipe prevents natural debris, such as leaves and twigs, as well as animals, from clogging the vent pipe. Vent pipe caps are relatively easy to install and come with explicit instructions. Using a chemical drain cleaner about once a month will limit the amount of natural and organic build-up that results in clogged drains. The best option with a chemical cleanser, with regard to routine maintenance, is to pour the chemical into the drain furthest from the main drain, thereby tackling build-up anywhere along the line.