Polygyny, the occurrence of multiple laying queens in colonies of social insects, presents a potential challenge to our understanding of evolution by kin selection. The ant species Leptothorax longispinosus is exceptionally useful for studying this problem, since populations vary in their frequency of polygyny and queen number had previously been linked to ecological factors of density of nest sites and overwinter survival rate. In addition, colony structure is complex, with nests undergoing fissions, fusions, and worker exchanges. Here we investigate genetic and spatial structure in three North American populations of this ant. Worker-worker relatedness remains high in these populations, primarily because queen-queen relatedness is likewise high; despite considerable genetic structure within nests, however, we found no evidence of spatiogenetic structure between nests. We conclude that the nest is the functional unit of selection for these populations. Across nests, there appears to be consistent, strong, stabilizing selection for intermediate levels of polygyny in two northern populations. Variation in queen number among populations and among nests within populations thus represents the outcome of a complex interplay between genetic and ecological factors.