The iPhone has market share. Developers go where the market share is. Microsoft's desktop developer community is so strong because they own such a dominant slice of the desktop market. The iPhone is no different.
The Android market is making a really strong showing. It's not to the scale of the iPhone app economy yet, but with stuff like the N1 and Desire coming out, the potential for Android's market share to increase is quite strong, and with that come developers. If Android phones were to become popular enough, I have no doubt that developers would desert Apple and its punishing app store policies and gateways in record time.