Maybe they were jealous of Bell's success or popularity in the story.
There could be various reasons. One possibility is that they were influenced by some external force, like an enemy who promised them something in return for betraying Bell. Another reason could be that they had some hidden grudges against Bell that finally came to the surface. It's also possible that they were simply weak - willed and were easily lured into betraying Bell for their own personal gains.
It could be that they were misled. For example, they might have been tricked into believing that Naruto was a threat to the village in the future. So, in an attempt to safeguard the village they love, they decided to 'betray' Naruto. This would add a lot of complexity to the story as Naruto discovers the truth later.
One possible reason could be jealousy. Maybe Ash has achieved more in his Pokemon journey than his friends, and they can't handle it. Another reason might be some misunderstanding. For example, an enemy could trick Ash's friends into thinking Ash has done something bad. Or perhaps there's some sort of power struggle. If there's a powerful item or a rare Pokemon involved, and Ash is the main contender, his friends might be tempted to betray him for their own gain.
Perhaps Danny's friends are lured by a powerful and evil ghost who offers them something they desire, like wealth or power. In exchange, they have to turn against Danny. They might start to sabotage Danny's ghost - fighting efforts, for example, by giving false information to his enemies. This would be a huge betrayal considering they were once his closest allies.
It could be due to outside influence. For example, an enemy of Sakura might have bribed or threatened her friends. Her friends, being weak - willed, then choose to betray her.
One possible reason could be jealousy. Maybe Naruto has been getting more attention from the village elders or teachers because of his potential. His friends, feeling left out or overshadowed, might start to ignore him out of envy.
In the fanfiction, it could be that Danny's friends have their own problems to deal with. They might think that being associated with Danny is bringing more trouble into their lives. Maybe they get threatened by a new villain who warns them to stay away from Danny. Or they could simply be growing apart as they enter different phases of their lives and their interests no longer align with Danny's.
It could be a character from a rival group. They see Bell Cranel as a threat to their plans and so they betray him by setting him up in a dangerous situation.
One possible reason could be jealousy. If Naruto becomes too powerful too quickly, his friends might feel overshadowed and abandon him out of envy.
He might overcome the betrayal by focusing on his own growth. By becoming stronger both physically and mentally, he could rise above the pain of betrayal. He could also look back on the good times with his former friends and use that as a motivation to move forward and prove himself.
One reason could be a misunderstanding. Maybe Harry said or did something that his friends misinterpreted. For example, if he was overheard making a comment that seemed critical of them but was actually taken out of context.