I think as INFPs, we're just so willing to give our all, you know? Like if someone needs help, we're one of the few people to actually give them it. And not just help, it's help from the heart, help that matters because we actually care about that person, no matter if we just met, or if we've been friends forever.
So did you think you were becoming friends with them for the long run (developing a relationship) or did you see yourself 'being a friend'?
Sometimes people are in need and they are motivated by making themselves feel better. It's completely situational and opportunistic.
As long as you can clearly see that before extending yourself, things might be okay. But, even if you understand that, I think it can be hard for XNFPs to set good boundaries and realistic expectations.
I see INFPs getting railroaded all the time, and I've been there myself. After a point, I took the "locus of control" back to myself. Just speaking for myself, instead of blaming others for being selfish, deceitful, childish, etc. - I put the responsibility squarely on myself for letting it happen.
The thing us, I think a lot of, if not all of the time, you
know when you are getting taken advantage of but you allow it to happen for...X, Y, Z reasons?
Once you figure out what those X, Y, Z reasons are and recognize the patterns, you can prevent it from happening again.
It doesn't hurt to value your own time and energy more and to be more selective. If someone is hurting and you turn them away, it's not the end of the world. They will find something or someone else. In fact, you may be giving them a valuable lesson.
There will always be people in need in the world, one of these days, you will be that person - and if you keep going like this, you'll be in need SPECIFICALLY because of all the people you feel used you.
Leave something for yourself.
You will find that there are quality people who want quality relationships with you but all this attention you give to the needy gets in the way.