If the counteroffer is amazing, it will poison your relationships with everybody in the company: colleagues will resent you for getting what they will see as a golden ticket when they didn't, and managers will resent you for what they will interpret as mercenary tendencies -- i.e. you're just waiting for someone to come along with an even better offer before you sell them out. So you'll have to work with a bunch of people whose opinion of you has just dropped through the floor.
And if the counteroffer isn't amazing, why would you consider taking it in the first place?