He decided he didn’t want me anymore and it’s clear he used me to be his caretaker who did stuff for him but he didn’t for me, so why does he message me still??
Control.
He keeps in contact because he might still need to use you in the future: you could just be some psychological backup utility person for things he doesn’t want to deal with.
I mean, he did switch from liking me to not liking me and when all went wrong, liking me again, so it’s very likely.
You were useful and he thinks you felt strongly enough about him to go back to him and keep being useful. Maybe he has found that others aren’t as useful or are less tolerant of him taking advantage of your generosity.
There is a possibility that “casting you aside” may be an effective manipulation tactic, taking advantage of your issues with abandonment to emotionally manipulate you into doing as he wants.