bayern didn't want to let Lewandowsky leave, Lewandowsky wanted to leave because from what I could understand the team wanted to hire haland to replace Lewandowsky and he didn't like that attitude from bayern and started campaigning to leave bayern as soon as possible, it wasn't a good attitude how bayern treated Lewandowsky. as for money, bayern has money and has been able to manage the players well, they have something very good, which is not constantly selling players and being harmed by such a sale
But they did not want to satisfy Lewandowski demand with a longer contract and good salary for him. Bayern knew that old players can have worse performance after one or two seasons and giving old players too high salary is risky. It is not good if the old player suddenly can not play well as he did before. It is risky for a club structure too if other players raise similar demand when they want to resign or expand their contracts with the club.
despite bayern being a strong team, they cannot underestimate the opponents, in the bundesliga if bayern played with team B they would not have any chance of being champions of the bundesliga, they would be relegated in my opinion, i say that because all teams in the Bundesliga are strong, it's not a place where you should play with a B team and expect a good result.
With team B, they can win some matches and it is enough for them because they already have team A which dominates Bundesliga already. So they only need to have acceptable performance from team B or some substitute players when they need these players. In reality, it is rarely to see Bayern to start a match with a full team B so risk to lose more points is smaller.