This means that this action was considered as making him right with God, benefiting him and his descendants forever.