Requirements vary by State in the U.S. Here’s an article about Hawaii requirements: https://www.staradvertiser.com/2010/10/16/hawaii-news/kokua-line/restaurants-not-required-to-have-public-bathrooms/
"Restaurants not required to have public bathrooms
By June Watanabe Oct. 16, 2010
Question: I have encountered several places that serve food but do not allow people to use their toilets. They all say they have no public restroom. But if they serve food, aren’t they required to have restrooms for their customers?
Answer: No.
Many people assume all restaurants are required to provide public restrooms, but the state Department of Health requires public facilities only if the restaurants serve liquor.
In that case, the restaurant is required to provide toilet facilities based on the number of customers it can accommodate.
However, the Health Department does require food establishments, including restaurants, to provide restroom facilities for employees to ensure safe sanitary practices.
It might surprise you to know that state law also does not require shopping malls to provide public restrooms, although restaurants within a mall would be subject to the requirements listed above.
As the Health Department explained to Kokua Line previously, its administrative rules on sanitation govern food establishments, such as restaurants and markets, and places of public gathering, such as theaters, schools, dorms, auditoriums, churches, amusement places, etc.
Requirements for “minimum sanitary facilities” can be found in the department’s Sanitation Administrative Rules (see gen.doh.hawaii.gov/sites/har/AdmRules1/11-11.pdf)."