Barcelona are due a rebuilding phase. It happens. What they're in right now is a typical position you get in American sports. Look at all the legends who wind up plying their trade somewhere new in the twilight of their careers, because the team they're forever associated with can't afford to hold on to them any longer. Tom Brady at the Bucs, Brett Favre at the Jets and Vikings, Peyton Manning at the Broncos, Jerry Rice at the Raiders, all examples of this. In sports like baseball and hockey where drafting is done pre-college, it's even more severe, as it's harder to guarantee the success of your draft picks, so a team with an elite but aging core will throw assets around aggressively to try to maximise the time with that top talent. Take the Pittsburgh Penguins. They have three iconic players, at least two of which are going to the hall of fame. All of them are well into their 30s now, so the team has mortgaged the future consistently in order to maximise success in the present. But now, injuries have piled up and the cupboards are bare, they have few tangible assets to trade, and those players are only getting further from their prime.
That's where Barcelona have been lately. Although Messi isn't that old, he's accumulated a lot of matches. And over the last few years the team has relentlessly spent on trying to keep the team at the level it was when it wasn't just Messi + supporting cast, but it was a once-in-a-lifetime super-team (run by a guy who plays a spoiling game built around fouling as soon as possession is lost, enabling them to dictate the pace of play). As those players like Iniesta, Puyol and Xavi have aged out, the team has had to throw money at the problem of replacing them because they can't afford, with their demands and Messi's limited peak years, to allow players to bed in for a couple of seasons first. They're still paying instalments (with interest!) on players who came in, didn't succeed and were sold on at a loss. Messi demanded a side that can compete for silverware, and the fans' expectations were that too. La Masia is not producing the same hit-rate as it did ten years ago either, increasing the need to bring players in from elsewhere. Poor asset management is costing them as they fail to cash in on young players until their value has been tanked (e.g. Munir el-Haddadi, who saw the team marginalise him and hurt his value to the point of being thrown away for €1m), while there's been far too much buy-high sell-low in the team's philosophy in the win-now mentality.
But the problem is, football is not like American sport. The hockey teams who throw those assets away in the pursuit of wins will then follow that with a phase where they're unable to compete; they will then auction off all the supporting cast for futures, enabling them to restock the cupboards with draft picks and prospects and not worry too much about being competitive until those players mature. But European sport has jeopardy. You can be relegated if you do that, and to be honest for a team like Barcelona, simply not being the best anymore is enough to upset the fans. For teams whose identity is built around something other than winning, they can ride out the bad times. But Barcelona are at the point in their cycle where they've got no assets left to trade, Messi has reached his mid-30s and isn't getting any better (and his defence, never particularly a strong point, is getting lazier) and the injuries take longer to heal. But American sport works like it does because there's a salary cap to enforce parity, and there's a draft system to prevent permanent dynasties. That serves to put a cap, literally, on the spending that a top team can do, and if they can't fit their Galacticos in that figure, they have to forgo some Galacticos. That doesn't exist in football, and so a team that is threatened with the end of its dynasty can't be stopped from throwing money at preventing that... until the money runs out.
Let's be honest, however well or poorly this has been handled, Barcelona would, in a perfect world, have wanted to hold onto Messi. He's a club legend, and has brought them countless trophies and riches thanks to the eyes from around the world (unlike, say, the Premier League or the Bundesliga where it is distributed more evenly among the division, in Spain the teams negotiate their own TV contracts and the money is shared based on what the teams individually draw, so a team like Barcelona or Real can perpetuate their position at the top by bringing in more TV money than smaller teams). And he obviously doesn't want to up sticks and move around having been settled in one place for so long, and with a club that he literally owes his career to (they gave him the HGH treatment that made him big enough to actually make it as a professional). But Barcelona's finances are such - largely because of the contortions done to retain and to placate Messi, mind you - that they were faced with a hard decision. The money isn't there to keep frittering away on stars, and as Messi gets older and they can depend less on him to provide a one-man show, the more money and resources need to be spent on the supporting cast; money that they don't have and, so far into the red, they can't reasonably ask for, so they had to trim costs. Re-signing Messi, even at a pay cut, would cost so much they'd have to sacrifice so much of their supporting cast that it would make it almost impossible for them to be competitive enough to justify the money being spent on retaining Messi's services at this point in his career. The romanticist in you may hate it, but in reality, Barcelona had little choice - they sacrificed the face of the club to save the club itself.