We study the spatial expansion of banks in response to banking deregulation in the 1980s and 90s. During this period, large banks expanded rapidly, mostly by adding new branches in new locations, while many small banks exited. We document that large banks sorted into the densest markets, but that sorting weakened over time as large banks expanded to more marginal markets in search of locations with a relative abundance of retail deposits. This allowed large banks to reduce their dependence on expensive wholesale funding and grow further. To rationalize these patterns we propose a theory of multi-branch banks that sort into heterogeneous locations. Our theory yields two forms of sorting. First, span-of-control sorting incentivizes top firms to select the largest markets and smaller banks the more marginal ones. Second, mismatch sorting incentivizes banks to locate in more marginal locations, where deposits are abundant relative to loan demand, to better align their deposits and loans and minimize wholesale funding. Together, these two forms of sorting account well for the sorting patterns we document in the data.