Even I am struggling to understand how exactly did this violate ToS?
Was it "illegal code/file"? No! It was a file to a s/w that had the potential to be used maliciously, but the file uploaded itself wasn't, but hadn't really manifested in that form (yet).
I feel asking the dev to take down the Github project is ok, but blocking/restricting access to the file itself, until proven malicious was a bad idea. And if that part about taking down the HN is true, its a dick move.
Yes, its their platform and from an ethical stand point, being proactive this way helps everyone, but it could have been handled better.