I think this kind of problem happens due to unreliable hosting company, therefore to avoid such kind of situations choose reliable and popular web host because they provides the extra layer of security.
Sometimes its not just the hosting but the fact that people wanted to show that they can do whatever they wanted in able to tell others that they can rule. That hacking thing was started when the two groups of computer people have been disagree to each other on what they have started.
I hope those hacked sites secure their servers more. Esp. web hosts, this can be very disastrous to clients.
Almost 90% article directories were hacked...it was because of the open source script those all were using got cracked by hackers...never the less all those are back with wordpress mu installation...& we all know that we can trust on wordpress!
i had a site hacked, and it wasn't even my fault. it was on network solutions, who didn't have proper safeguards in place for their servers. it was a huge mess for thousands of customers, eventually i just left that horrible company. Network Solutions sites hacked again - Computerworld