Maybe the friend betrayed the village in a really bad way. In the Naruto universe, loyalty to the village is important. If the friend joined the enemy and was causing great harm, Naruto could see killing them as a last resort. For instance, if they were about to give away crucial secrets that would lead to the destruction of the village.
It could be a case of a misunderstanding that gets out of hand. In a complex plot of a fanfiction, Naruto might believe his friend has done something unforgivable like killing an innocent person. In his haste to deliver justice, he might end up killing his friend before finding out the truth. This would then lead to a great deal of remorse and self - discovery for Naruto as he realizes his mistake.
One possible reason could be to gain more power. Maybe he thought that emotions were holding him back from reaching his full potential as a ninja. He might have seen other powerful ninjas who seemed to be emotionless and thought that was the way to go.
One possible reason could be fear. Naruto has the Nine - Tails inside him, and the villagers might be so afraid of the power of the Nine - Tails getting out of control that they decide to take extreme measures. They might see Naruto not as a person but as a potential threat that needs to be eliminated.
One reason could be Sasuke's thirst for power. If he believes Naruto is the only obstacle in his path to ultimate power, he might be driven to kill him. In some fanfictions, Sasuke may be influenced by a dark entity that twists his mind into thinking Naruto is a threat that needs to be eliminated.
Maybe in a fanfiction where Kakashi is mind - controlled. It could lead him to harm Naruto without his normal self - control.
It might be for the greater good. If Obito's actions in the fanfic are leading to destruction on a large scale, Konan, being a protector of sorts, decides to take him out to save the world or at least her part of it.
Another reason might be related to his pursuit of power. If in the fanfiction, Naruto is constantly facing stronger enemies and he believes that his current strength is insufficient to protect those he loves, he might attempt to sacrifice himself in a desperate attempt to gain more power, like through some dangerous and forbidden jutsu.
One possible reason could be that Sasuke might have gone too far in his pursuit of power even after the war. He could have been a threat to the newfound peace in the ninja world, and Naruto, as the protector of peace, might have felt he had no other choice.
One possible reason could be extreme guilt. Maybe Naruto has done something he believes is unforgivable, like accidentally causing the death of a beloved friend while in a fight. He might think that death is the only way to atone for his mistake.
Another reason could be related to a prophecy. If there was a prophecy in the fanfiction that Naruto would bring great destruction in the future, and Kushina, being a self - sacrificing mother, might think that killing him is the only way to prevent that destruction, even though it goes against her natural love for her son.
One possible reason could be a misunderstanding. Maybe she was misled by false information about Naruto being a threat to the village. Another reason might be that she was under some kind of mind control. In some fanfictions, dark magic or evil entities can take over a character's mind and make them act out of character.