As a person with a nigh unquenchable thirst for carbonated soft drinks, I am around vending machines many, many times a day, even though I actually purchase things from them very infrequently. Anyone who's used a vending machine is familiar with the situation in which you buy something, the machine whirrs for a bit, and then you receive nothing because it's stuck. Of course, from time to time, the opposite happens: you buy an ice cream sandwich, and you get two ice cream sandwiches, probably because some poor schmuck before you paid for one but didn't get it, and didn't have enough change to buy a second one. I began thinking: is it moral to take the second item that you didn't pay for?
First, that item belongs to someone else. Almost certainly a faceless corporation of some sort, but even that faceless corporation is owned by individuals. On some technical level, the item doesn't belong to you, so taking it is stealing. On the other hand, if you leave the item in the bin, the chances are extremely high that the next person to use that machine will take it, and the net effect on the rightful owner of that candy is exactly the same. One could even perhaps make an argument that since you're at least as likely to lose out due to vending machine errors than to gain from them, you're just balancing out the universe, righting some nonspecific wrong that most likely occurred in the past. That argument is fairly weak to begin with, especially if you consider that the last time you bought something from a vending machine and didn't get it the machine was probably owned by someone else.
It seems to me that for an act to be immoral, then it probably has to be due to a choice that you've made. The difference between murder and killing in self-defense is that in the latter situation, you had "no choice" but to kill the other person in order to save your own life. I put "no choice" in quotes because of course you did have a choice—you could have let them kill you to avoid taking another person's life. But, sacrificing yourself to prevent a would-be murderer from dying is not what most people would call a practical choice, and in the grand scheme of things, not particularly beneficial to society anyway. The vast majority of people would consider murder to be immoral, but I think that most would say that killing purely in self-defense is moral. So then it seems that for an act to be immoral, it has to be a choice you made that had a more ethical alternative. (Of course, things are more complex than that: in my opinion, there are plenty of situations in which you have no moral choices of action because of prior immoral choices that you've made, but I don't think that's relevant to the tasty treat at hand.)
That word practical is what I think makes taking a Charleston Chew that you didn't pay for morally acceptable. Since it's my stance that leaving the candy accomplishes nothing for the righteous forces of good since someone else will surely take it anyway, the remaining course of action is to, what, call the company that runs the vending machine and ask how you can return the candy to them? That's not practical: it's a waste of time for both you and the company given the small value of the item. They probably don't even have a procedure in place for how to accept returns of candy that was vended accidentally anyway. Are there really any other options then? Take the candy and don't feel guilty.
But what if it's not a pack of Juicy Fruit, but rather an iPod at one of those bizarre Best Buy vending machines that they have in airports? The scenario is nearly the same, except that for an item of that value, Best Buy probably does want the item back. The difference is the price. In my gut, it seems that the most moral thing to do if that happens is to take the item and find a phone number, and then either give the item to airport security or call that number and ask Best Buy what to do. That's what I would do. I would feel bad about keeping it and then exchanging it for something else in a store later.
The ethics of lost Skittles seem to score a point for moral relativism.