That's absurd. I cannot imagine what that cashier was thinking except that he must have been enjoying his version of a power trip. If they do have such a minimum-age rule on that magazine, that doesn't make a lick of sense considering that weed itself is illegal and not restricted to people over a certain age.

Call the manager and complain. Then let him know you'll take your business elsewhere in the future and will encourage everyone on a large, international online discussion forum to do the same.