Why does macbeth kill two guards?

He kills the guards so that they will not be able to tell the truth: that they had nothing to do with the death of Duncan. Silencing the witnesses is always a good policy if you are trying to prevent the truth from coming out.