This is contrary to the canons of literature of religions worldwide, but I do not believe that the purpose of life is to generate good karma or avoid sin in order to have a better afterlife. Of course it is important that we are 'good'. Otherwise we would kill each other off (take note, U.S. military) or live in insufferable conditions. But there is more.
I come from an artist and hippie community, where everyone is 'good'. But what is interesting about that community is the meaning in life that unfolds from everyone's path in life. It is meaning that our Spirit is after, not a tally of all the good things one does in one's life. 'Good' is the platform for the meaning in life.
Sure, if good deeds are obviously needed in life, do them. But the real purpose of much of our lives is 'meaning', the unraveling of our soul, what makes us tick, the artistry and logic of our being. That is the beauty of our lives and the reason for our being here. That is what is interesting and the point of our existence.
Where we get into trouble is if we ignore the concepts of religion in pursuit of meaning, such as being arrogant or damaging land and life. The two (religion and our reason for being here) are in tandem, balanced.
Love all you can and live your religion but I urge you to find meaning in life and pursue it doggedly. In the end you will be so pleased! And so will everyone else.