You are writing loosely without saying what a 'terrible phone' means to you. Perhaps you have a model where the camera is not as good as the previous model or perhaps another function does not come up to scratch for you, but how do I know, and therefore answer your question, unless you specify what, in your eyes, is terrible about your phone - performance, cultural impact, sales or design? There have been poor products, notably, the Rokr1, the first iTunes phone but it wasn't really an iphone and was discontinued after one year. It's not still for sale.
The reason that Apple is still able to sell terrible phones at such high prices is very simple. There are consumers out there who are still willing to pay those high prices for the brand. Apple is one of the most highly recongizable brands that are around today. Around the world, the Apple brand carries a lot of clout. This can be proven with the increase in mobile phones and the popularity of the Apple brand in China. The Chinese are on tap to become the biggest market for Apple. While the critics are panning Apple, the consumers are saying otherwise and going on and purchasing the products. Competition is becoming tight in the smart phone sector with cheaper alternatives to the iPhone but the thing is that the iPhone and Apple have a brand that has staying power. Their phones might be deemed terrible by some but there is still that consumer yearning that will keep Apple and its phones relevant.