The same right that lets society force a business... a food-service business, for example... to heat its chicken to 165 degrees; and to rotate its milk stock; and to sanitize, not just wash, its dishes; and to trash unused ingredients after their expiration date.
A business is not a person. It is a convenient legal fiction... a piece of paper in a filing cabinet somewhere. It doesn't have rights. It has privileges, extended to it in excess of those of a person. And it receives services from the state in excess of those extended to a person. As such and in return, it is entirely appropriate to regulate it in ways that the state would not regulate a person. Go ahead and "cook" your own only to 140, if that's the way you want to run your home kitchen. But don't you dare do so in a commercial kitchen.
Health codes for businesses are in the interest of the greater good of society as a whole. So are anti-discrimination laws. Go be a bigot on your own time.