Sexual selection is most often thought of as acting on organismal traits, such as size or color. However, individuals habitat use may also affect mating success. Here, we show that, in threespine stickleback, nest depth can be a target of sexual selection. In postglacial lakes in British Columbia, male threespine stickleback nest in a narrow range of depths. Prior studies revealed heritable variation in males preferred nest microhabitat. We surveyed four natural populations, finding that male stickleback with shallower nests were more successful at breeding. Indeed, nest depth was a much stronger predictor of male mating success than more commonly studied targets of sexual selection in stickleback (size, condition, shape, color, infection status). This selection on nest depth means that variance in fitness changed predictably across microhabitats, altering the opportunity for sexual selection to act on other traits. Accordingly, we show that sexual selection on other male traits is strongest where variance in nesting success is highest (at intermediate nest depths in some lakes). We conclude that males choice of nesting microhabitat is an especially important target of sexual selection, resulting in fine‐scale spatial variation in sexual selection on other traits.