I don't see this as a problem with the rules, though. If the GM is screwing with a druid or ranger's animal companion "just because he can," then he is, quite simply, doing it wrong. It wasn't that 3E didn't like giving GM's that power (though, to be sure, it pushed forward ideas of player empowerment), as the quote I made before is from the 3.X DMG, it's just that it - like all editions - presumes that the GM isn't trying to be a jerk.
This works on both sides, too. Player empowerment can just as easily become player entitlement.
If the GM tells the ranger that his grizzly bear won't follow him into the desert, for example, the player can either say "that's a reasonable assumption, given the extremely high temperatures and the bear's fur coat, not to mention issues of not being a natural habitat for it," and start trying to figure out if he'll have the opportunity to leave the desert in the near future (e.g. after the adventure's over), or if he'll be there a while and should start looking for a new animal companion.
...or the player can say "oh come on! This is a world with fire-breathing dragons and demon-blooded sorcerers, but a bear in the desert breaks your immersion?! Damn it, this is a class feature, you taking this away weakens my character, and you're doing it just because?! Nuts to you, I'm going to Google "bears in the desert" and I'll bet I can find freaking dissertations saying that grizzlies will venture into deserts, then will you stop mucking up my ranger already?!"
In either case, the GM is making what I think is a reasonable call; sometimes things don't go exactly how the player(s) would like, but that doesn't mean that the GM is screwing them when that happens.