The confederates defended Petersberg so fiercely because losing it would have made it impossible for Lee to defend Richmond. Furthermore, it acted as a crucial supply depot for the confederates, being situated right near the Appomattox River combined with a rail depot.