Restaurants often impose those charges because they’ve been legally required to spend more money. Putting it on as a surcharge keeps it out of the gross receipts, a percentage of which usually go to the landlord.
Some government mandates exempt places with fewer employees or charge different rates for medium and large numbers of employees. For example, only businesses with 50 or more employees are required by the ACA to insure them. If a restaurant with a lot of employees is competing with restaurants with few, just increasing prices to cover the costs would make them less competitive.