Pure and simple. Anybody with the personality trait of being as kind as possible to others has a distinct weakness that they might not realize. People constantly say "don't mistake my kindness for a weakness" but it is. What caused you to actually have to say that statement? The fact that you realized that someone took advantage of that weakness. Yes you can change how you deal with the person afterwards, but it still happened. Your human weakness was exploited by someone you wouldn't have expected.
The interesting thing is, the people that end up taking advantage of your nice/generous/loyal/concerned/dependable nature is always someone that you wouldn't expect to do it. Of course that is as it should be, if you expect someone to take advantage of you, you would prevent it before it gets to that point. Instead, it's family, it's close friends, and it's significant others who are always the ones willing to see just how much they can benefit at you're expense. Consideration is not one of the easiest things for people to consistently have and when it comes down to you or them, they almost always pick them. You on the other hand also pick them because it's who you are as a person. The most selfless people are always the ones looking back and realizing that they shouldn't have done something
What happens when you confront someone on this usually? They either attempt to flip it in some sort of way or they apologize only to try to repeat the offense at a later time. Unfortunately, if you are the type that is usually being taken advantage of due to your overall kindness, it's not an easy trait to change. You might tell yourself it won't happen again, but lets be honest, it does. Sometimes it's by a brand new person, sometimes it's by the exact same one. Either way it's going to happen a few times, maybe a lot, before you start being more cautious as to how nice you are to certain people.
Kindness is a characteristic that most people have and it's part of being human. Problem is, it's one of the main reasons people look back and say to themselves "I was being really stupid" when thinking about a particular scenario. Unfortunately tho, it's tied to emotions. The more you care about a person, the more they can get over on you. Even when they do, you give them more and more chances because you truly love/care about them. Even when you are aware of it, you still let it happen because of who the person happens to be. I guess it's just something you have to try and be more aware of and learn from when dealing with certain people.