Apple does not have a dominant market position and does not give away iOS for free.
Making Android free is an anti-competitive practice because it inhibits the formation of a competitive market for mobile phone operating systems. Because Google's practice of making Android free inhibits competition they are not allowed to exploit the lack of competition for profit.