The Uchiha massacre was one of the greatest controversies and tragedies of the Leaf Village. Many say it was an unavoidable disaster, and was the end result of the racist policies of the Second Hokage, Tobirama Senju.
However, upon a closer look at things, it might seem that this entire segment hangs by a series of loose threads, plot-wise.
At times, it almost seems as if the entire subplot involving the truth about Itachi annihilating the entire clan was a pedestal to place this character on. Here's why.
Was the Uchiha massacre unavoidable? Or was it a plot made just to uphold Itachi Uchiha?
As revealed to Sasuke by Obito Uchiha, Itachi was given a highly confidential mission by Danzo and the village elders to annihilate his entire clan in order to prevent a coup d'état by the clan.
This entire plot hangs on the fact that the Uchiha would have launched a coup big enough to topple the government and cause considerable damage to the village. So much so that other nations could take advantage of this and it could lead to a Great Ninja War.
However, the nature of the coup that Fugaku and others were planning is entirely unknown. Furthermore, given Fugaku's nature, who was ready to give his own life for the path his son had chosen, it does not seem like they would have wanted an all out war against Konoha.
Moreover, many of the Uchiha seemed to be peace-loving people (Sasuke's own mother), and it seems unlikely that they just went and agreed to a plan of bloodbath arranged by their Chief. Given that the clan had clear heads like Shisui.
Therefore, it is possible that the coup was meant to put pressure on the government to change the conditions under which the Uchiha were kept in the village. Even if that wasn't the case, the Third Hokage could try making things better through negotiation.
It is notable that the rejuvenated hatred towards the clan was because of the Kyuubi attack. Although Hiruzen himself never gave in to racist hatred, he never launched an investigation as to what caused Kurama to appear in Konoha out of nowhere.
In light of this, it certainly seems that the plot was meant to fan hatred towards this dreaded clan. Of course, it was ultimately Danzo who gave the order to annihilate them, surely with his own motives (gaining the power of Izanagi).
However, the complete annihilation of a clan is a hate crime no matter the circumstances. Furthermore, there must have been other approaches that could have been tried, as Fugaku Uchiha did not seem to be an unreasonable man.
Even during Tsunade's Infinite Tsukuyomi dream (although it isn't canon), Minato managed to achieve peace through negotiations with the Uchiha.
Perhaps things could not come to this because of Danzo, who triggered the pacifist in Itachi by invoking the horrors of the war that might come about if the Uchiha turn against the Leaf.
Overall, the massacre seems to be pretty far from unavoidable, and it certainly could have been stopped by a little more effort from the Konoha administration.