Here is what Pearce Delphin a.k.a @zzap had to say for himself:

 

"I did it merely to see if it could be done, that JavaScript really could be executed within a tweet. At the time of posting the tweet, I had no idea it was going to take off how it did. I just hadn't even considered it. I discovered a vulnerability, I didn't create a self-replicating worm. As far as I know, that isn't technically illegal. Hopefully I won't get in trouble!"