Webb was an inspired choice by the Dems. A legitimate war hero and SECNAV under Reagan, Webb had a broad appeal in a still conservative state that is starting to trend Dem [NoVA]. Webb did especially well among the military retirees and active duty in the Norfolk and Virginia Beach areas, usually strong Rep. The fact that Webb had a son going to Iraq also played well.
The bottom line is a combination of Allen gaffes and a strong Dem candidate spelled a victory for Webb. It is also interesting to note that the WP endorsed Webb's opponent in the primary.