The US used to have much more diverse vending machine offerings, including prepared hot foods and drinks, but they started to disappear in the 1970s, though you could find stragglers into the 1990s in older institutional settings (e.g. government buildings), especially for drinks--coffee, hot cocoa, etc. As previously mentioned, I think they fell out of favor because they began to be considered very poor quality (it's a death spiral if turnover doesn't happen fast enough), perhaps as compared to increasingly popular drive-thru alternatives. I guess in a way it was a result of our car culture. Like with the demise of cafeterias generally[1], Americans preferred to jump in their car rather than choosing from what was available within walking distance.
[1] A wall of vending machines selling sandwiches, salads, soups, and hot drinks constituted a "cafeteria" in many buildings.