You need to review your bank's procedures and maybe talk with your account manager to straighten out how the fees, penalties and holds work. The account balance does not always reflect funds that you have access to. Some banks indicate that available balance, as well as the total funds. The action can be legal if it's part of the conditions you agreed to when you opened your account.
Please note that I am answering this question as a service through Avvo but not as your attorney and no attorney-client relationship is established by this posting. An attorney-client relationship can only be established through signing a Fee Agreement and paying the necessary advanced fees.