Richard Gaywood Speculates On The Reasoning Behind The iPhone's Screen Size
The decision was probably fuelled by more than just this, but I reckon the impact of screen size on the keyboard UI must have been carefully accounted for in the design of the final hardware. As Gaywood notes, the iPhone keyboard does feel very tied to that exact size. The width of the keys (and the spaces between keys) seem to sit at the limits at what is comfortably useable.
Robert Scoble has recently remarked that he expects Apple to allow the text input interface in iOS 7 to be replaced by third-party solutions. I don’t agree. I think Apple sees the keyboard as the crown-jewels of iOS. Letting external developers mess around with something so core to how the phone is used is just not in line with Apple’s style. Cook commented at D11 that they will open up iOS in ways that do not compromise the user experience, but I am confident that custom keyboards fall in the ‘compromising’ category and are not imminent.