I don't know if it's legal or not but I've never seen any guarantee that transactions will be processed in the order they are made. And the people who it happens to aren't the type of people who can afford an attorney anyway.
It wasn't banned and it is still quite legal. Overdraft fees are banks' bread and butter. They continue to process withdrawals before deposits and many process them in the order that maximizes overdrafts.
In 2012, banks took in $32 billion in overdraft fees up $400 million from the previous year. The record was hit in 2009 with $37 billion in overdraft fees collected by banks.