For years, Bank of America used its government-backed U.S. banking subsidiary to finance billions of dollars in controversial trades that helped hedge funds and other clients avoid taxes, according to internal documents reviewed by the Wall Street Journal.