there's no such thing as what you describe, it's simply physically impossible.
most likely it's related to one of the following: you're formatting via windows, which means the spyware/trojan/virus is just copying itself back on as soon as you wipe off, or it's on your local network in which case the same thing is happening across the wire, or it's coming over on some program or application you install after you've wiped the drive and put the OS back on.
to really do a nice format, do it via DOS with a DOS boot disk, or do it from a Linux machine that's known to be clean. I had a friend with a trojan on a BACKUP PARTITION of his disk. He was only formatting the O/S partition. Not sufficient. you have to wipe everything, including destroying the partitions.