> It's a reasonable question - but the price can never be truly "free," because there's a cost to investment / build that product - meaning costs are non-zero.
Those are fixed costs which can be amortized in other ways.
For example, Google could make both the OS and the hardware to sell together, like Apple. In fact, they do, with the Nexus/Pixel devices. Once they've done that, the OS development is a sunk cost. Giving it away to others or not has no effect on cost, or has negative cost if some of the others make contributions that you can use on your own devices without paying to develop them internally. And it grows the ecosystem your products are a part of, which is a valuable service the other vendors are providing for which some remuneration is appropriate, which could offset some or all of the cost of the software.
Moreover, software costs money to develop, but how much of the development cost should be apportioned to each unit? That depends how many units there will be. Not have been -- will ever be. This value is not known and can be arbitrarily large. For something like Android it is very large. If you amortize the development cost over the number of devices there are/will be, the cost per device is negligible -- small enough it would be eaten by transaction costs if you tried to collect it.
And claiming that companies can't give away software because they're large is clearly bad policy. It would imply that e.g. they can't contribute to Linux.