This is like saying that getting a Tesla is greener than walking (once laundry is taken into consideration).
Which is true, if I was to walk from Land's End to John O Groats then I would need a lot of food for that plus the overnight stays in guest houses would not be that green as the sheets would be changed daily rather weekly-ish.
A friend of mine is not capable of washing dishes unless there is a scorching hot tap at full beam running straight to the plughole for rinsing purposes, no hand basin is used and the plug is nowhere to be seen. No draining board support is allowed to spoil the kitchen aesthetic and anything washed has to be dried with those paper towels you just use once and throw in the bin.
Fortunately for people like my friend there are dishwashing machines. Since they do have a machine and it has to be put on anyway, there is therefore no harm in my friend using a different cup everytime he wants a cup of tea. Therefore there will be a good dozen mugs and glasses in there by the time the machine goes on.
Undoubtedly the dishwasher definitely makes sense and is more economical now!!!
Meanwhile I just make do with the same cup that I wash each time I need it, a quick rinse, usually without chemicals. Come main meal time I also manage to wash as I cook so there is only the plates and a couple of pans to wash at the end. Of course you could put the dishwasher on for that or wonder what happens if you have a vast Mormon family, but it does not have to be the case that the dishwasher is greener.