Cost and benefits of CRISPR spacer acquisition