A federal regulation sets forth the time frames in which deposits must be made available.
For cash deposits that are made to a live teller, the funds must be made available by the next business day.
For cash deposits made at a proprietary ATM (one owned by your bank), the funds must be made available by the second business day.
If you make a cash deposit at an ATM that is not owned by your bank, the bank has up to five business days to make the funds available.
Bear in mind that "cash" means currency only - it does not include money orders or cashier's checks (although postal money orders are treated the same as cash).
So if you made the cash deposit to a live teller on day one, and day two was a business day, the funds must have been made available by THE END OF day two.
I have a feeling that the "end of" part may have been where the OP got into some of his trouble, and where he could arguably say that the funds were held for two days: if I make a cash deposit at 9 am today, the bank isn't legally required to release the funds until (in most cases) 5 pm tomorrow. For all intents and purposes that's a two day hold, but it still fits within the law.
As for the sequencing of debits, I'm kind of torn. On the one hand I can understand the logic that larger checks are typically the ones that you really don't want to bounce (rent, utilities, etc.). But if you have overdraft protection this argument is moot, and at any rate it will inevitably, always, result in the maximum number of possible overdrafts.
Unfortunately, there's not a whole lot we can do other than to keep applying pressure to these banks to end their abusive and unreasonable practices. But you can certainly let your dollar do the talking: get out of the mega-banks and switch to small, local banks or credit unions.
Best regards!