Eto'o was the third star in the times Rijkaard, alongside Ronaldinho and Deco (and a young Messi), and he had many problems with teammates, up to a point that when Guardiola was appointed as a coach, he tried to sack all 3 of them and make Messi the only star of the squad.
The reason why was that Pep wanted to do a fresh start in the team and have the homgrown players have more weight in the squad. Ronaldinho and Deco were instantly sold, but Eto'o asked Pep to have a second chance.
Guardiola really didn't want him in the team, but there wasn't a better striker in the market, so he decided to give him a chance.
Eto'o did a brilliant season showing he was the best striker out there, but he collided with Pep now and then, and worse of all, he had some encounters with Messi. He just couldn't cope with Messi becoming a superstar, and Guardiola wanted Messi to take a bit the role of Eto'o.
Plus, Eto'o didn't make it easy at all. He had only 1 year left in contract, and he didn't want to renew. And in case Barcelona tried to sell him, he wanted 15M€ for himself as part of the deal.
So, Barcelona had a player with only 1 year of contract, with a market value of 20-25 M€ (15 M€ of which had to go to Eto'o himself). It was a very difficult decision for Barcelona, but the best was to try to swap him for another great striker.
That's why the deal Eto'o - Ibra finally took place. Barcelona could value Eto'o at 40 M€ (even if in the market's logic no one would have paid more than 20 M€ for a player with only 1 year of contract) and offer it to Inter to get Ibra for 35 M€ (that is the sum that Barcelona ended up paying for Ibra).
I think it was a good move considering the situation, the problem was that Ibra had exactly the same problems with Pep and Messi and we ended up signing Villa, who in my oppinion, is the perfect player for us right now.
It was a pitty to loose Eto'o, who is a great striker, but the situation was unavoidable for all parts.