Evidence suggests that banks tend to lend a lot during booms and very little during recessions. We propose a simple explanation for this phenomenon. We show that instead of dampening productivity shocks, the banking sector tends to exacerbate them, leading to excessive fluctuations of bank credit, output, and asset prices. Our explanation relies on three ingredients that are characteristic of modern banks’ activities: moral hazard, high exposure to aggregate shocks, and the ease with which capital can be reallocated to its most productive use. At the competitive equilibrium, banks offer privately optimal contracts to their investors, but these contracts are not socially optimal: banks reallocate capital excessively upon aggregate shocks. This is because banks do not internalize the impact of their decisions on asset prices. We examine the efficacy of possible policy responses to these properties of credit markets, and derive a rationale for macroprudential regulation in the spirit of a Net Stable Funding Ratio.