If the investment turns out to be a good one, the bank's owners and managers benefit from the profits. And if the investment fails and the bank must close, deposits are still protected.
Subordinated debt is a way to remove a bank's incentive to go for broke.
In the case of default, the bank would be barred from making any payments on the debt until all depositors or other senior debt holders were paid off in full. Therefore, sub-debt holders would be left holding the bag if the investment failed. Because sub-debt holders put their money on the line, they have an incentive to monitor the bank. If the bank's behavior should become riskier, investors will demand a higher premium for bearing that risk, and the interest rate will increase. Not only would potential investors be alerted by such information, but regulators too would find it useful as a signal that a bank needs more attention.