Creating a virus is a form of machismo. The virus creator actually gets a sexual rush similiar to what a dominatrix or sadist feels.
We already know that a majority of virus creators are male. And we know that most uber-geeks who become virus creators are the most sexually frustrated human beings on earth, even more than Catholic priests.
THEREFORE, the only practical solution to this problem is immediate FULL CASTRATION: removal of both the testes AND the *****.
Once the sexual organs are removed, the virus creator will no longer receive sexual pleasure from interfering with other people's lives. The ex-hacker Eunuch will be shamed forever and forced to carry the physical scars of their idiocy forever.
AND this will serve as an incredible deterrent. It's a well known fact that hackers have an incredibly close and intense relationship with their own *******.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic