Sure. But all the things Gmail offered were things that probably looked like lousy investments to Yahoo. Why offer more storage? Why have better spam filtering? Why have better security? It all costs money!!!
The point is only looking at actual cost, not opportunity cost.