Just watching 2001: A Space Odyssey, one must conclude that HAL was incorrect. By killing off the crew, HAL was making the mission unlikely to succeed. The crew were there to carry out the mission... killing them is detrimental to the mission.
HAL killed the crew to prevent them from shutting down HAL for repairs. The crew would have kept HAL running, possibly at reduced capacity, and continued the mission.
The above just considers the original movie, but we also have a canon sequel, 2010. In 2010 we find out that HAL was given secret orders, and ordered to lie about them to the human crew... and we find out that HAL wasn't really built to lie, and the tension involved in the lie drove HAL insane. (Also, in 2010 we see HAL again, with the secret orders removed; he is no longer insane, and he proves to be a trustworthy companion to the end.)
So on the one hand, we know HAL was insane at the time he started killing the human crew. On the other hand, HAL was operating under secret orders, and killing the human crew was actually compatible with the secret orders.
Quotes from the movie 2010 at IMDB
In essence, HAL was told "get the ship there even if the crew is dead, and don't tell the crew anything about this." HAL was not told to keep the crew alive. HAL essentially had a single prime directive, the human crew threatened this prime directive, and HAL dealt with them.
If the human crew shut down HAL and operated him at reduced capacity, HAL would be unable to carry out the secret orders. So I would say that HAL was correct, but only in reference to the secret orders.