That's not how it works. Tobirama was the one who cast out the Uchiha, eventually they grew fearful of Madara's warning and planned out a coup d'etat. Danzo being in a leadership position had no choice but to take action, either the village suffers from war leaving it a target for other countries to join the fray, leading to a 4th Shinobi war, or take out the Uchiha and minimize the losses.