We construct a model in which bank capital regulation and financial innovation interact. Innovation takes the form of pooling and tranching of assets and the creation of separate structures with different seniority, different risk, and different capital charges, a process that captures some stylized features of structured finance. Regulation is motivated by the divergence of private and social interests in future profits. Capital regulation lowers bank profits and may induce banks to innovate in order to evade the regulation itself. We show that structured finance can improve welfare in some cases. However, innovation may also be adopted to avoid regulation, even in cases where it decreases welfare.