There is an in-depth thread on here on this very subject. I'm sure someone will link it here soon.
But, the bottom line is, WD-40 is a penetrating oil. It gets past the seals and displaces the lube inside the chain links. Once that happens, internal wear on the chain is accellerated.
Having it come off the sprockets at speed may have damaged the chain as well, but I would think that kind of damage would be felt as you continued to ride with that chain still installed...