I have been hacked!

How could this happen? My website has been hacked in the beginning of this week! As a reaction my provider immediately took it offline, because a script on the server has been used to send out spam…