But in respect of Gates' letter, Woz didn't write that BASIC for free, he wrote it to enable his hardware platform and the time spent writing it is a cost/investment in the platform. Gates was just trying to make a business writing software without the hardware.
Also Apple are the ones that made Gates' sentiments a reality with the precedent set in Apple v Franklin (1983) defending the copyright of their BIOS software.