On top of that, the jobs it does require are skilled. Engineers to design it, mechanics to repair it. They aren't jobs like a barista that you can get without any experience or education. Even the work of assembling it can be outsourced to some third world country, or automated itself.
That is not necessarily true, as the company could be subsidizing its labor costs in order to gain salad-vending marketshare.
Once manufacturing is underway, the process is typically made as efficient as possible and made to scale. The work that went into design and testing can now be scaled to thousands or millions of units which is a great return on investment. Each unit has a one time cost for materials used for parts, with some long term maintenence costs.
Operation requires only an electric energy draw. If that energy is from a clean source such as solar, this unit isn't having much of any further negative impact. Operation could last years or decades depending on design and whether or not the product is superceded, at which time its parts can be recycled. Even then, the time spent on design will be used to create the next version.
Supplying the machines with goods is already a task handled when goods are delivered to the location and stocked, so there isn't going to be much or any overhead added there. Plus, we can automate that too (self-driving vehicles for transportation, robots for the last leg of delivery and stocking).
Human workers do not scale in the same way that machines do, and aren't typically as efficient at this type of task.
Finding suitable human workers is difficult and can take considerable time and resources every time one is hired.
Human workers are expensive, and this is an ongoing neverending cost. This cost will not scale down as you hire more workers or work them for a longer time (unlike machines).
Human reliability is hit and miss. Also, you cannot work them 24/7. There is lots of downtime and you would require at least 3 or 4 humans to replace 1 machine if the task requires 24/7 uptime.
The enegry that humans consume and their waste is typically not effecient. Three meals a day, often including animal products which are costly in terms of resources and environmental impact. Then there's waste treatment for them. And the energy costs to deliver the food from a farm to their location, and even farm growing and harvesting.
None of this is as effecient or "green" as a renewable energy draw such as solar, wind, or hydroelectric delivered over a power line.
On many levels, humans are a poor replacement for machines in predictable tasks such as making a coffee or a sandwich for a chain restaurant. Humans are good for social work, and making coffee is not social.
In terms of someone needing a job, even if that job is meaningless and unnecessary, basic income should be provided instead. But that's a whole other conversation and we aren't there yet.
Point is: Machines are efficient. Social impact is a different conversation.
A robot has no way of knowing if the coffee will taste good or contains rat poison. It's just going through the motions. If it serves you a dud drink you can't argue with it, you just got scammed. Post an angry Yelp review if it makes you feel better.
Fewer, higher value employees has been the trend in many industries for the past few hundred thousand years.
You can, however, force people to lower their expectations until they can be trivially formalized. That's what happens with tea/coffee vending machines. The dispensed drink is really bad, but it's uniformly bad, and since people don't expect quality coffee from a vending machine, they don't complain.
The cashiers are gone. The fry cook is gone. The drive-thru order taker is gone. The cooks are gone.
You'll still have a preparer that will probably also do running (they'll bag the multiple, separate items up and take them to the front). You'll have a shift manager that will help with a bit of everything (eg if a customer has a problem with the order kiosk or payment). You'll still have a human cleaning the building and parking lot, taking out trash. There will also obviously be people routinely involved in machine maintenance, installation, etc.
There will be some complication with condiments and food layering. There will probably be a position for food ammo reloader, that keeps the machines loaded with whatever that machine cooks / prepares.
It would be possible to get rid of the bagger/runner, but it'd probably be cost prohibitive and needlessly complex to assemble the various robots on a line that could also bag properly.
At its best, eventually, this system will produce more food (1.5x to 4x I'd guess), at a lower per customer cost, with superior food safety (including hygiene). Then it's a question of how much of that gain gets competed away (benefiting customers) and how much goes into the pocket of the owners.
Starbucks will be similar. They won't get rid of all their humans, they'll reduce their number significantly.
It's likely to be a decades long, piece by piece, transition. The early results won't be spectacular for either customers or franchise owners, it'll take many years of gradual improvement.
A robot just does what it's told.
Starbucks used to have manual machines and the results were...variable. Some days you'd get a substandard drink, but if you got someone who knew what they were doing, the results were fantastic.
It's like before the coffee would be anywhere beteween a 6 and 9 out of 10. Now they're consistently 7.5 out of 10 every time. Boring, predictable, never bad, but never great.
Eventually automated systems ought to be able to do this better than most people can. Why couldn't there be engineered sensors that could detect such things very well?
And given that the act of making good-enough coffee isn't a very difficult task (given how readily available and quickly trained "baristas" are), and how mechanical the process is already, im not sure there's anything to suggest it isn't do-able. Its more likely a matter of cost and scale
Replicating this with electrical sensors is a pretty complex task we still haven't managed to get working, after all we are not only talking about replicating the sense of taste but also the sense of smelling and how they interact with each other.
Generating a brand new style of good coffee might need the interaction though
How to calibrate a sensor for something like that on a per user basis? I don't know, but apparently it's possible because "electronic noses" do exist but are mostly used in laboratory settings, probably on account of their price.
There's also a reason why we still use pigs and dogs for work that require good smelling senses, like search&rescue or truffle foraging. Training these animals is very expensive, but it still seems to be the cheaper option compared to building "smellobots", so I doubt smelling sensor are far enough along to be put into a ton of kitchen bots at small cost.
This is not a trivial matter! Cost is entirely the reason a host of technologically-possible automation hasn't happened outside a lab.
The sun will eventually engulf the Earth rendering this argument irreelvant.
Smell, taste and poison are all matters of physical molecules and how these interact with human physiology. We already understand these to some extent. We can already build devices that can detect some of these things to some extent. We have no grounds to say it's impossible for a human-level ability of it to be engineered. (Note that lack of positive evidence against X is not the same as positive evidence for X).
That human gets paid a salary and earns a living.
And that human could presumably choose not to push the button if the expresso machine tries to become sentient (in theory).