If you search our news you'll find a few issues like this related to Virgin Media and separately Microsoft strategy, which cover similar areas. In general though an ISP can sometimes, but certainly not always, very generally pick out spam or other malicious activity by looking for unusual activity on their network and ports that relate to a known abuse (botnet, virus, Trojan etc.).
Prevention is a more complicated matter. ISPs will normally warn and assist infected customers first and in some cases providers, such as Virgin Media, have been known to temporarily suspend connections for accounts that fail to address a problem that could be causing serious problems for other internet users. But you can't easily prevent such things from happening without sacrificing the open nature of internet access.
The ultimate responsibility is with the computer owner to ensure that they have adequate security.