The products people buy are extensions to their personality. People who buy iPhones identify with the device and show it off as if they are showing a great part of their own being. It's the same reason why a person would show off his great car.
iPhones are expensive, and as a result, those holding it are usually the ones who can afford to pay more for a phone. Some people buy iphones to advertise their social status or even their earning power (See why people buy branded clothes).
Apple has been known for its superior quality since its early days. From a quality point of view, the iPhone is truly superior to most other phones.
The design of the iPhone targets the unconscious desires of the human mind with its simplicity, playfulness and ease of use. So many people fell in love with the phone as soon as they saw it, and never bought any other phone.
Apple has done its branding job perfectly. The Apple brand is not only known for its quality, but it's also known for its exclusiveness. Once branding is done right, people stick to the product and feel proud holding it (see why branding is very important for business).
Since there are so many cheap Android phones in the market, iPhone users feel like they belong to the superior group that can afford to pay so much for a phone. Humans always like to display superiority and some products can help them achieve that desire.
Apple was the first company to invent the smart phone we know today. Samsung came later and just copied the iPhone. This created an image in the customers' minds that Apple is the original, while Samsung is just the cheap copy.
People like to be different. When the iPhone was new very few people were holding it and this is why those people got great satisfaction. People can sometimes buy brands that only a few other people buy to make a statement that they are different.
iPhone apps rarely crash, the app store doesn't have spam apps, the operating system is very stable and the phone is much more reliable than a typical Android.