Don't they have to?
In the US, there's a law that says all places that serve food and aren't on a public street (e.g. a food truck), have to have a public toilet.
At least in my jurisdiction, gas station don't have public toilets because they want to---they have it because since they serve reheated hot dogs, they are required to have a toilet.