why are leaves modified into spines in the cactus plant
It help prevent water loss by reducing air flow close to the cactus and providing some shade
Cactus
 As well as defending against herbivores, spines help prevent water loss by reducing air flow close to the cactus and providing some shade
wiki:1537834
Cactus [SEP] Introduction
Cacti show many adaptations to conserve water. Almost all cacti are succulents, meaning they have thickened, fleshy parts adapted to store water. Unlike many other succulents, the stem is the only part of most cacti where this vital process takes place. Most species of cacti have lost true leaves, retaining only spines, which are highly modified leaves. As well as defending against herbivores, spines help prevent water loss by reducing air flow close to the cactus and providing some shade. In the absence of leaves, enlarged stems carry out photosynthesis. Cacti are native to the Americas, ranging from Patagonia in the south to parts of western Canada in the north—except for "Rhipsalis baccifera", which also grows in Africa and Sri Lanka.