To intentionally buy online via credit card and return in store for cash purely to collect the points can't be anything but fraud. It may not be provable or prosecutable, but the intent is fraudelent. It is stealing the processing fees from Costco.
I love collecting points and miles.....but this is clearly way over the ethical line.