D&D was initially designed based on wargame perspectives. In wargames, your playing pieces are largely expendible, and the original D&D game treated them as expendible, or at the very least fragile. When the roleplaying hobby began to take hold, people started to place value on playing an ongoing character with personality and a story, and fragile expendible characters and "Gotcha!" DMs didn't work well with that, and people started playing the game differently than it was written.
That's not really true, or at least incomplete. Players in Dave Arneson's Twin Cities Blackmoor campaign had ongoing characters with personalities and stories from 1971 (The Great Svenny, Robert the Bald, Marfeldt the Barbarian, Sir Fang, The Blue Rider, Mello the Hobbit, etc.) and the same happened in the Lake Geneva Greyhawk & Kalibruhn campaigns (Robilar, Tenser, Terik, Murlynd, Yrag, Mordenkainen, Bigby, etc.) from 1972. It is true that low-level (especially 1st level) characters were viewed as essentially expendible, and it was considered a waste of time to invest a lot of backstory in a starting character because odds were about even that he'd never survive to 2nd level, but the idea that these folks who were playing the same character week in and week out for a year or more and working them up to 10th+ level didn't feel any more attached to them than a unit counter in an SPI wargame and didn't invest them with personalities and stories, that this is only something that arose in later years and was unintended or even contrary to the rules is absolutely false.
The difference between how characters were played then and how they tend to be played now is that the personalities and stories developed gradually and organically
through actual play, rather than being predefined before play ever began. Rob Kuntz didn't arrive in Gary Gygax's basement that first night in 1972 thinking that he was going to play Robilar the sardonic loner who will eventually turn to Evil, he just had a 3x5 index card with a set of character stats that looked more like a fighting man than a magic-user (or cleric, if that class existed yet) and everything else developed gradually over the next couple years of play.
As for the "Gotcha!" DMs, that was (believe it or not) the style of play these folks preferred -- they liked being tricked and challenged and having to think and fight their way out of tough situations where they knew the penalty for stupid mistakes was character death (unless you've got a wish or two handy to save yourself). The better the players did the harder Dave and Gary and Rob tried to come up with things to challenge them, not because they were sadistic power-tripping bastards but because that's what the players wanted and demanded. Look at, for instance,
Journey to the City of the Gods, a story based on a D&D game Dave Arneson ran for Gary Gygax (as Mordenkainen) and Rob Kuntz (as Robilar) -- these were both long-term, high-level, fully developed characters who Arneson nonetheless threw in way over their heads and very likely would've mercilessly killed off had Gary and Rob not saved themselves via some quick thinking and a precipitous retreat.