Likely because you didn't un-optimize the image before processing (
Filter>Animation>Unoptimize). In an "optimized" GIF, most frames are reduced to what changes from the previous frame, and superimposed over the accumulation of existing frames (in Gimp, the corresponding layers are marked
(combine)): if the object is in front over a white background, the next frame includes a bit of white to paint over the part of the background that reappears.
Of course this requires that the image as a whole is opaque, if you use objects over a transparent background there is no way to "erase" the bits if the objects that aren't masked by the next frame. Which means that the whole image should be un-optimized: each frame totally replaces the previous one (such frames are marked
(replace) in Gimp.