Nest site selection is a crucial decision for bees because where mothers construct their nests influences the developmental environment of their offspring. Small carpenter bees (Ceratina calcarata) nest in sun or shade, suggesting that maternal decisions about nest sites are influenced by thermal conditions that influence juvenile growth and survival. We investigated the costs and benefits to mothers and their offspring of warmer or cooler nest sites using a field experiment in which mothers and newly founded nests were placed in sunny or shady habitats. Maternal costs and benefits in sunny and shady treatments were quantified by comparing brood provisioning behaviour, nest size, number of brood cells, and offspring survival rates. Juvenile costs and benefits were quantified as body size, high temperature tolerance (CTmax), metabolic rate, and pupal duration. The major maternal benefit of nesting in sun was significantly lower rates of total nest failure (caused by predation, parasitism or abandonment), which led to sun mothers producing 3.2 brood on average, while shade mothers produced only 2.9. However, sun nesting entailed costs to brood, which were significantly smaller, less likely to survive to adulthood and had significantly elevated CTmax. This suggests that juvenile bees in sun nests bees experienced thermal stress during development, causing them to shunt resources from growth to thermoprotection, at the cost of smaller size and higher mortality. Pupae raised in a thermal-gradient BeeCR machine developed significantly faster at warmer average temperatures, which may be an additional benefit of sun nesting. Overall, our results highlight a tradeoff between maternal benefits and offspring costs when mothers choose nest sites, in which maternal fitness is enhanced by nesting in sun, despite significant physiological costs to offspring, due to the necessity for thermoprotective responses.