You'd think this would be one of those repairs that could have used spare parts. We know the Model 3 totals easily.
I don't know the extent of the firewall damage, but I'm guessing it was totaled because the firewall isn't exactly an easily replaceable part, even though it could be repaired or left alone and be likely fine. Unfortunately it couldn't be brought back to "factory condition" so it's totaled.
Demand for junk yard drive units and batteries will likely go down with the number of Tesla's on the road. Unfortunately the batteries can never be used by a certified Tesla repair shop again. Tinkers are buying them, but with the proliferation of the Model 3, the market will eventually start to flood with junk yard packs, which could be permanently damaged discharging while awaiting auction or processing. The efficient, environmentally friendly and sustainable path is to fix the car. Unfortunately due to insurance companies, our throw-away society and Tesla, this isn't the case.