Money does have a huge impact, but everything can not be measured by money. High loyalty can beat money (an example is Messi), as well as for young players who expect new challenges, in order to fulfill their desires they can do anything because they still have a long journey and the money will come by itself.
It's not a good thing to keep a player who has no heart for his club anymore, besides being able to affect performance, it can also affect the team's atmosphere.