However, if you requested £20, got £40 and £40 was debited from your account, then the cash is yours to keep, as neither you nor the bank has suffered any loss.
If people get wind of a cash-machine windfall and start queuing round the block, then they know full well that what they're doing is wrong, both morally and legally.