Yeah but I did know about the Ian and Barbara thing. They would have died instantly had he done it..
Well, at that point, all the characters' personalities had been affected by the anomaly. It was earlier in the same episode that Susan was going around trying to stab people with scissors.
Still, the Doctor was originally conceived as a more amoral and potentially dangerous character. Early on in the development process, they even planned for him to become the main villain of the show. Instead, they had him start out ruthless and then become more benevolent as he bonded with Ian and Barbara and learned kindness and nobility from their example (or maybe was reminded of those traits within himself). The story in question here, "The Edge of Destruction," was the turning point in their relationship, the moment where the tensions in the group came to a head and were resolved, bonding them together from then on.