It's the same reason Apple invests so heavily in Pages, Keynote and Numbers (all free apps on three different platforms). They believe that building software internally (taking hardware into account) leads to a better user experience, and sparks an intangible 'joy' when using their products--a sense of completeness that transcends software and hardware. This was the core of Jobs' philosophy and I think still drives the entire company.