The Curse of Hatred (憎しみの呪い, Nikushimi no Noroi), is an ideal that is said to have been passed down from the Uchiha Clan's forefather to his many descendents. The origins of this way of thinking can be traced back to the time of the Sage of the Six Paths, when on his deathbed the forbear of Ninja chose to name his younger son his successor over his older son, despite the elder's supposed birthright. The Sage chose the child he thought most suitable to continue his legacy (the younger, who believed love necessary to achieve peace, over the elder, who sought power to bring peace. Consumed by hatred and envy after their father's death, the elder son waged war against his brother, and began a cycle of conflict that transcended time and culminated in mutual hostility between the brother's descendents, the Uchiha and the Senju.
As Tobirama Senju revealed, the Uchiha treasured love and friendship even more than their own clan, yet it was their ultimate downfall. Because this is a part of them they regularly conceal, an Uchiha's love turns into hatred the moment they lose the ones they hold dear. This despair-filled experience would cause a manifestation of special chakra within the Uchiha's brain, affecting the optic nerves and creating the Sharingan, "the eye that reflects feelings". Even the ways for Sharingan to evolve further into Mangekyō Sharingan and Eternal Mangekyō Sharingan require an extremely painful experience that would drive the user into even deeper darkness that would utterly consume them. Such a ninja at the time was Madara Uchiha, who refused to relinquish his hatred after being forced to take his beloved brother's eyes to obtain the Eternal Mangekyō Sharingan prior to Konoha's founding. Uneasy of how long the Uchiha's standing in the village would last once Tobirama Senju became Hokage, Madara sowed the seeds of contempt among his kin with the promise that they would eventually lose standing in their partnership with the Senju if they did not help him.
As an Uchiha is plunged deeper into the darkness, even the slightest hint or mention of anything even remotely connected to the person whose death caused them to end up like this will cause them to become extremely angry as seen in Madara and Sasuke's case. Also, the Uchiha can't be reasoned with by anyone except the person who caused them to be like this, if the person can be reincarnated. Only that person has any chance of saving the Uchiha from the curse as seen in Sasuke's case.
Though Madara was exiled by his clan soon after, a few Uchiha would begin to believe his warning generations later, yet they were no longer in a position of power to do anything about it due to Tobirama's attempt to thwart the curse by placing the Uchiha in the Konoha Military Police Force to regulate their emotions. The Uchiha's curse was fully rekindled later as the result of Obito Uchiha witnessing the death of Rin Nohara, in turn causing the Nine-Tails' Attack on Konoha which resulted in the Uchiha plotting to take over Konoha after being unjustly accused for the event. This led to the Uchiha Clan Massacre executed by Itachi Uchiha, with Sasuke Uchiha's quest for avenging his family resorting in becoming what Obito noted as the sole inheritor of the Uchiha Clan's hatred and thus fated to clash against Naruto Uzumaki, who has inherited the Senju's Will of Fire. However, questioning his resolve, Sasuke has Orochimaru reincarnate the Hokage and learns the full nature of the Curse of Hatred from Tobirama. Having also learned from the past Hokage about the origins of Konohagakure, Sasuke choose to protect the village, and his brother's sacrifice instead of destroying it.
However, throughout generations there were Uchiha who were able to transcend the limitations of the limiting mentality of thinking only of their clan and place the village's well-being above all else. Uchiha such as Kagami — a subordinate of the Second Hokage, his son Shisui, and Shisui's best friend, Itachi all inherited the village's will and looked out for its well-being.