Why he did it
The truth, which Tobi tells Sasuke and the story later shows from Itachi’s own side, is that the Uchiha were planning a coup, and Itachi was a double agent reporting to the Third Hokage while trying to prevent civil war. His options were narrowed to two: support the coup and have the whole clan, including Sasuke, killed in the conflict, or accept an order to wipe out the clan first and be allowed to spare Sasuke. He chose his brother. Itachi’s parents told him in their last moments that they were proud of him and asked him to look after Sasuke. (Ch. 590)