That man is a parasite, and AskApril is right here that unless you change your own pattern, the person in front of you will continue to do the same. You should block this man in every way and strengthen your self-protection.
You asked why people do this. Simply, they consider you a resource, not a human being. When they need money or attention, they come back. Their return is not love, but their own benefit.
Cut him out of your life like he was never there.