In some fanfiction, it could be a misunderstanding. Sasuke might be framed for a terrible crime against the village. Despite Kakashi's doubts, the village elders pressure him to take action. And in a tragic turn of events, Kakashi ends up killing Sasuke before the truth comes out. Another motive could be that Sasuke tries to take revenge on someone important to Kakashi in a way that makes Kakashi feel he has to end Sasuke's life to protect his loved one.
Perhaps Sasuke is possessed by some extremely evil entity. And Kakashi, in an attempt to stop the entity from causing more destruction, decides to kill Sasuke. It could also be that Sasuke discovers some dark secret about Kakashi that Kakashi doesn't want revealed, and in a moment of panic and self - preservation, he kills Sasuke.
Well, it could be that Kakashi is under some sort of dark spell or curse that makes him see Naruto as a threat to the village. In some fanfictions, there might be a situation where the village's safety is at stake and Kakashi believes that sacrificing Naruto is the only way to save everyone. Also, it could be a case of false information. If someone convinces Kakashi that Naruto has turned evil and is about to cause great harm, he might take the drastic step.
One possible motive could be if Sasuke was on a path of destruction that endangered the entire ninja world. Naruto, as the protector of peace, might see killing Sasuke as the only way to stop him. For instance, if Sasuke was about to unleash a powerful and uncontrollable jutsu that would wipe out many innocent lives.
One possible motive could be to help Naruto control the Nine - Tails' chakra better. Hypnosis might be a way to reach into Naruto's subconscious and find a way to coexist with the powerful force inside him.
Perhaps in the fanfic, Sasuke was being pushed to his limits. He was so intent on protecting the village from a powerful threat that he didn't realize Sakura was in a dangerous position. His Sharingan might have malfunctioned in some way, causing him to misinterpret Sakura's movements as hostile. Or, there could be a situation where an enemy was using Sakura as a shield, and Sasuke's attempt to strike the enemy ended up harming Sakura instead, all in a split - second decision.
In fanfiction, Naruto might kill Konoha if he's under some sort of mind control. Maybe an enemy manages to manipulate his thoughts and turn him against the village. Also, if Naruto experiences a great loss because of Konoha's actions or inactions. Say, if his friends are killed due to Konoha's negligence in protecting them, and he blames the village as a whole. Or if he realizes that Konoha's system is so corrupt that it's causing more harm than good to the world.
One possible motive could be to use Sakura as bait. Maybe Sasuke is trying to lure Naruto to a certain location. He knows Naruto cares deeply about Sakura, so he figures Naruto will come after her.
One possible motive could be mind control. Maybe an enemy manages to take over Kakashi's mind and forces him to harm Naruto. Another could be a misunderstanding. For example, if Naruto was thought to be possessed by a powerful and dangerous entity that Kakashi believed could only be stopped by killing Naruto.
Maybe Red Hood believes that Batman's methods are no longer effective. He could think that by killing Batman, he can take over Gotham and impose his own brand of justice, which might be more brutal but in his eyes more efficient. This would be a great plot point in fanfiction to explore different concepts of justice.
One possible motive could be if his brother was somehow a threat to the village. Naruto is very loyal to Konoha, so if his brother was planning to destroy it or harm its people, Naruto might feel compelled to stop him at all costs.
One possible motive could be extreme revenge. After years of being mistreated, locked in a cupboard, and generally being made to feel unwanted, Harry might snap in fanfiction. Another could be a sense of self - preservation if the Dursleys were somehow involved in a plot against Harry's life in the fan - created plot.