Because the driver doesn't know about unforseen factors such as traffic that change in real time during the ride to the pickup point. We do not live in an ideal world.
Uber didn't invent upfront pricing. If you pass the cost of traffic onto the customer then drivers will drive in traffic on purpose and rinse the riders.