The policy is left to individual stores. That may be the problem. But at the same time, not every store faces the same situations, such as homeless or others who abuse their restrooms, forcing some Starbucks to weigh denying access so that they don't have to be constantly cleaning those restrooms and possibly denying someone access who will complain, especially to the media or allowing access to all and having to do a helluva lot more work (because most such places do not increase personnel for such things). It is a rock and a hard place. Some stores have simply closed off or completely removed public restrooms. The answer just isn't so simple.
[UPDATE] Toilet Terror: Starbucks Closing Its NYC Restrooms To EVERYONE: Gothamist
There needs to be some understanding by the public. I understand, at least to a point, because I've worked as a manager in retail. When we got our portable dressing rooms, someone peed in one (or allowed their pet or child to) and did not clean it up, so we had to. It was on the floor. Others were upset that we could close the regular fitting rooms early or not open them until later unlike other stores in the chain which didn't get the portable dressing rooms (we were a test store). Since we did get to close early, the store was also given less money for staff to cover those hours. Some stores in the chain have restrooms behind locked doors, which means someone had to run back there in our store at least to push the button to open the door to the restroom. Plenty of complaints on that one, especially during busy months. Not all stores in the chain have locks on their restroom doors though. (For retail stores, its more a security thing so that people aren't shoplifting while using our restrooms.) All of this goes into how much staff a store needs for any given time of day, and that means crappy working conditions for current employees at such businesses if they are thrown to the wolves that are customers who can't understand why they don't always get to use things for free.