Costco also requires member photos on the card, otherwise you'll need to show any government photo ID. However, you can enter as a guest if you're with someone with a membership.
You also need your membership card, with your photo on it, to make any purchases. Even when attending as a guest, you can't make the purchases yourself.
Without a membership, the most you can get is some of the free samples. For anything else, the cashier will probably suggest you going to the membership desk to sign up.
Doing so may raise flags in the system, and your account will be monitored. Future returns may then require a manager's approval, or in worse case, the membership may be canceled.
You'll need to have your receipt looked over when exiting the store. This is to maintain inventory control and ensure members have been properly charged.
This policy is in place to prevent people from shoplifting, but it can be good for customers too, as sometimes things get double-scanned or don't ring up at their sale price.
Costco enforces the rule of "no shirt, no shoes, no service," which has been around for at least 50 years. It remains in place for hygiene and safety reasons.
Bare feet can bring in germs and bacteria and are also prone to injuries that may happen due to items lying on the floor. Shirts, however, are likely required for general decency.