It's not the computer that Microsoft is selling, it's Windows. It's apples and oranges (no pun intended). Apple doesn't charge for its software and Microsoft has many other products. It's just about how you distribute your costs.
FWIW, Microsoft has a much higher profit margin than Apple.