Dendritic spines receive most excitatory connections in pyramidal cells and many other principal neurons. But why do neurons use spines, when they could accommodate excitatory contacts directly on their dendritic shafts? One suggestion is that spines serve to connect with passing axons, thus increasing the connectivity of the dendrites. Another hypothesis is that spines are biochemical compartments that enable input-specific synaptic plasticity. A third possibility is that spines have an electrical role, filtering synaptic potentials and electrically isolating inputs from each other. In this review, I argue that, when viewed from the perspective of the circuit function, these three functions dovetail with one another to achieve a single overarching goal: to implement a distributed circuit with widespread connectivity. Spines would endow these circuits with nonsaturating, linear integration and input-specific learning rules, which would enable them to function as neural networks, with emergent encoding and processing of information.