He’s saying that a life lived with a view toward long term consequences works out better than one that seeks to optimize near term benefits. He uses Christian language because this was from a book on Christianity, but the principle is a sound one. It’s the gist of the famous Stanford marshmallow experiment. People with the ability to delay gratification tend to have better lives.
I like @syz‘s version best. I do think, however, that the “heaven” part of the original statement could be considered metaphorical; “reaching for heaven” is like “reaching for the stars.” I think the “Earth thrown in” part is was threw me off of Lewis’ quote, not the reference to heaven.