It is one of three things :
1. The machine got hacked - Someone managed to find a way to hack the ATM and was just showing off.
2. The ATM malfunctioned - The hardware or software malfunctioned and it pumped out money like crazy!
3. It was a publicity stunt - Something like this will draw a lot of attention, so the company who owns this machine did this on purpose to draw attention to the machine.

In any way, it did draw a lot of attention and I think a lot of people are sleeping next to that machine in the hope that it would do this again.

true that, i don't think this was a malfunction, such machines are designed very well, especially when it comes to spitting out the money to the people, but hey - everything can broke down sometimes, and there's nothing we can do with it.
I'd rather say it was somehow hacked or damaged by purpose by someone who just wanted to amuse us ;d