The worst bug ever is the arithmetic mistake made by a programmer of a FORTRAN program which crashed a probe to Venus. Millions of dollars down the drain just like that, and just a simple programming error.
That may be the most costly bug ever in terms of money, but there have also been a (small) number of human fatalities resulting from software bugs. Those are arguably much worse than the Venus probe.