Is its purpose to provide an oasis of snacky goodness to those who happen to encounter it while passing through? If so, then yes, all it needs is dollar in, item out.
I'd argue, though, that vending machines that are in places where they are regularly encountered by the same people over and over again, such as vending machine in office buildings, dorms, schools, and such have a higher purpose.
They are to provide those who live or work near them a snack safe space. A place they can count on to take a quick break from their work day and find their favorite snacks.
A vending machine that could keep track of regular customers and their snacking habits could better fulfill that purpose. For instance, suppose Carol from accounting only ever buys Tab, and the machine is running low on Tab. Dave from marketing likes Dr. Pepper best, with Pepsi a close second, and only rarely buys anything else.
Dave tries to buy the last Tab (perhaps by mistake). The smart vending machine could recognize that it would be better to reserve the last Tab for Carol, and could tell Dave, "I'm sorry Dave, I'm afraid I can't vend that to you. Would you like a Dr. Pepper or Pepsi instead?".
The future didn't give us the flying cars and jetpacks we were promised, but at least it can give Carol from accounting a reliable Tab supply at work.