Because the store is free to set whatever conditions of sale they want, provided it doesn't discriminate on prohibited factors (eg race, gender or disability).
But since it is their policy and not the law I'm well within my rights to complain to the store management about their policy ... which is what I do .