First, I want to address all the negatives about counter-offers. I don't think people are accepting the way things are priced in the real world and it's probably why they're not in sales (And why sales people do a better job of getting higher salaries.). There are many forces at work that affect a salary and the main one is what someone is/was willing to accept. The open market is not the only driving factor. Some employees are worth more to a specific company. When a particular position is worth less to the company than what the market indicates, the company is in a bind and may have to get less talent or someone, for whatever reason, is willing to accept the lower offer.
The reason your current employer didn't pay you more is they didn't offer and you didn't ask for more. That's really the bottom line. Over the course of time, people realize their talents are worth more, but usually not until they get a better offer. Example: If your work generates a million dollars in revenue, no company can afford to pay you that much, so how much do they have to pay you? Half? 90%? If they can get someone for 30% and not deal with the negative consequences that can come from too little salary (turn-over, lack of effort, unhappy employees, etc.), they'll do it until someone asks for more.
What to do in your case.
If you are considering taking the counter-offer, just tell the other company, my company made me a better offer. They can decide to make another offer or give some other reason why they think you're better off joining them without the increase salary.
Don't even think that you're doing anything wrong. You didn't force your current employer into making a counter-offer. Your employer wanted to make a counter-offer, and when anyone tries to hire someone away from a current job, they better know that can happen. To think any less of someone who stood up for themselves by asking for more, are totally unprofessional, childish and need to understand the concept of "It's just business." When people don't demand what they're worth, they are not respected as much. If someone doesn't "like" you because you asked for more money, that's their problem. We work, we get paid. You make something, you try and sell it for what it is worth. Don't waste your time with people who don't want to pay you what you can get.