Foreseeably, there was an immediate late-night run at that ATM until the police were called to disperse the crowd and deactivate the ATM.
A rogue ATM is rare, but it happens all the time, so much so that companies pay an extra paycheck before word gets to the accounting department that someone quit.
Do you have to give money back if it's someone else's fault you were overpaid? In an era of direct deposit and automatic bill pay, it's often hard to know exactly what's been paid and when and whether it was really yours or not.
So, there's nothing criminal if you legitimately didn't realize that a company overpaid you — though you still need to give back money you didn't earn. If you knowingly keep money that you know should not have been sent to you, you are committing theft by deception.
As for the ATM customers, they put in their actual ATM cards, so the bank has already applied the actual withdrawal amounts to those accounts.