That’s what they said in the later 2010 movie. But in the 2001 movie, it looked like Hal went nuts because his simulated emotions made him prideful of his own perfection. So when he got caught making a mistake, he couldn’t handle it and killed all the witnesses to cover it up.
Yes, but the reason HAL went crazy in 2001 was he was told to lie and it broke the code