Not all Linux distributions are free. A market share can also be taken by a product which is free. It’s just a piece of the market.
You don’t count OS market share by the amount of money you spent for an OS (because then, MacOS would be free, since it’s technically given away bundled with Apple hardware) but by the number of installs.