>'Why did Sony keep creating such hard-to-code-for devices and yet end up with such a monstrous install base?'* Exclusive Titles: They managed to lock down some of best regarded franchises in each era.
* Backwards Compatibility: Each generation, at least initially, has been fully compatible the generation prior.
* Versatility: DVD capability in the PS2 was a fairly big deal at the time. Blu-ray in the PS3 was not, but it did look good in a bullet-point comparison against the 360.
* Free Online Features: The price of an XBL subscription is a deterrent for some.
* The direct problem of being hard-to-code-for always improves with time as developers gain experience and the toolset improves. At some point, you're only going to worry about content, not what's underlying.
A couple of those points are the sort that don't matter at all to 'smart' gamers and well-heeled adults who can own as many consoles as they like, but these are devices that ideally ship a few hundred million units to people of all ages and wide demographics.
By the way, the Cell [1] (PS3) is pretty interesting stuff if you're into computer architecture.
1: http://en.wikipedia.org/wiki/Cell_(microprocessor)