Because the value of gold and silver is somehow less arbitrary than electronic bank balances.
Depends on who's running the bank, doesn't it? The value of gold and silver fluctuate with supply and demand worldwide. They have industrial and decorative uses and a widespread base of people willing to own them. In the absence of large-scale deep-space asteroid mining technology flooding the market with excess supplies, they're going to remain fairly valuable.
Or a cheap way to extract gold from seawater; remember aluminum was once considered a precious metal on par with gold. It's not really scarcity of the resource but the scarcity of the available supply.