I’m a needy guy. If someone fulfilled a major need of mine, I would work to be as close to that person as possible. That means fulfilling needs of theirs.
I think that saying is used to condemn shallow, one-sided relationships. However, there are deeper relationships where one party benefits more than the other in the immediate, but the other benefits from a sense of purpose gained by helping the needier counterpart.
Maybe the saying began as a wise observation, and still is, but I’ve heard it used to promote stigma towards accepting a needy friend into life. But altruism is the way of life, literally. In healthy relationships, it isn’t about debts and loans between those involved.