Note that profit-driven entities can give away software, but only if it supports another artificially scarce good. Google rents space on its search tool, as Facebook rents space on its social media tool. Ad space is scarce, and made more valuable the more Google and Facebook give away (which is proportional to the attention they capture).
But devs generally don't like artificial scarcity, so the platforms need a path in for them. I think Apple demonstrates this most clearly: the iPad and iPhone are software consumption devices, but the Mac is also a software creation device, and therefore is generally more open, free, and changeable.