Why does my toilet overflow during my washer's spin cycle?
There is a partial blockage in a pipe common to both the washer and toilet. With the blockage, the path of least resistance is out of the toilet, so that's where the water goes. This blockage needs to be cleared.

Often, gurgling is a sign of faulty drain venting. In your case, I hope it's just incidental to water working it's way back up to the toilet, and not an actual vent issue.