Fountain soda costs a few pennies per gallon, the lost earnings of which would ordinarily be counted as small beans compared to the wages saved by reducing the bodies you need to pay to run your restaurant. The pandemic taught companies though that you don't need a body for every job, you need only as many as it takes to keep the door unlocked. The single person whipped and frantic doing the jobs of eight people will just have to work harder and maybe next year they'll get a fifteen cent raise
the extra labor to fill and refill dining room drink orders is very temporary. robots or automated dispensers will be pouring the drinks long before 2032.
they used to have automated dispensers and robotic 'fry guys' at some locations... back in the early 1990s
that's an individual store problem. it isn't one at most stores with self-serve fountains.
many mcdonalds even put self-serve cup dispensers next to the self-serve kiosks, which would make it even easier to grab a freebie.
eliminating 1-3 fountains from every store reduces the maintenance part of their coke contract by a not-insignificant amount. that's the primary motivation here. the somewhat long time frame would be required to accommodate terms of existing contracts and changeovers would happen as those are renewed or renegotiated.