Matt Cutts blogged about how Google keeps its index clean by deindexing hacked sites. In his post, he explains that hacked sites can be detrimental to the search experience especially if malware is hosted there and is installed on a visitor's computer. Therefore, Google takes preventative measures to remove those sites so that visitor machines are not inadvertently compromised in any way.
Matt explains that Google also sends numerous reports to the webmaster of the particular domain (contact@, support@, webmaster@, and info@) to inform them of the issue. The email is typically entitled "Removal from Google's Index." Of course, if you register your website with Google's Webmaster Tools, you can get the information there when you log in as well.
If your site is removed, you have a few days to act upon it before Google removes your site from the index, but once everything is clean again, you can file a reconsideration request and be readded.
In 2006, we covered when the Jennifer Convertibles site was hacked and delisted from Google. Within 2 days, it was back in the index. In this case, Google acted fast because the webmasters acted fast to remove the malicious code from their content.
Forum discussion continues at Sphinn.