Yeah I understand your question.. I think what you are asking is, if I always do "good things" with the intention of getting a good life wont that be accounted for "greed", right?
But the issue here is according to Buddhism the ULTIMATE GOAL is NOT a good life.. ultimate goal is to break away...