The evolution of viviparity is a key life-history transition in vertebrates, but the selective forces favoring its evolution are not fully understood. With >100 origins of viviparity, squamate reptiles (lizards and snakes) are ideal for addressing this issue. Some evidence from field and laboratory studies supports the “cold-climate” hypothesis, wherein viviparity provides an advantage in cold environments by allowing mothers to maintain higher temperatures for developing embryos. Surprisingly, the cold-climate hypothesis has not been tested using both climatic data and phylogenetic comparative methods. Here, we investigate the evolution of viviparity in the lizard family Phrynosomatidae using GIS-based environmental data, an extensive phylogeny (117 species), and recently developed comparative methods. We find significant relationships between viviparity and lower temperatures during the warmest (egg-laying) season, strongly supporting the cold-climate hypothesis. Remarkably, we also find that viviparity tends to evolve more frequently at tropical latitudes, despite its association with cooler climates. Our results help explain this and two related patterns that seemingly contradict the cold-climate hypothesis: the presence of viviparous species restricted to low-elevation tropical regions and the paucity of viviparous species at high latitudes. Finally, we examine whether viviparous taxa may be at higher risk of extinction from anthropogenic climate change.