I think what we do matters, but empirically and in this world. It is sad to think the only thing that keeps some people from barbaric behavior is fear of afterlife punishment, but if that’s what it takes, I won’t complain. :)
Actually refraining from Evil Deeds out of fear of punishment doesn’t help you in the next life. It is your desires and intent that matter. If you desire to murder someone but don’t out of fear of going to jail or being executed, you are still a murderer at heart. Just like lusting after other women other than your wife makes you an adulterer at heart. You will be accountable for that in the next life.
Death strips away the false fronts we carry around with us in life, and leaves only the bare naked soul in all its glory and or depravity of heart.