Yes, this is legal. Having a credit card with the same bank having checking or savings account with & getting behind on credit card payments, they will deduct what is owed from these accounts. It is probably written somewhere in your banking agreements which you agreed to.