Bank of America’s legal woes are only partly to blame for its disappointing quarter