As someone who is often in urgent need of a toilet, I disagree that we should force businesses to simply open their washroom doors to anyone.  I do believe that setting a 'minimum' and 'maximum' amount for the use of a washroom is reasonable and should offset some of the cost of stocking and cleaning it.

Some businesses in Europe do require a purchase and then your receipt has the code to gain access to the restrooms.  No reason something similar couldn't be implemented here in various stages. 

As for the homeless etc etc, time to set up portapotties in easily accessible areas and hire them to keep them clean.