Water scarcity and soil degradation pose challenges to sustainable agriculture. Phosphogypsum, a low-cost solid waste, shows potential as a soil amendment, but its impact on water saving and soil quality need further study. This research assessed the effects of phosphogypsum application rates (CK: no phosphogypsum, 0.075%, 0.15%, 0.3% and 0.6%) on soil infiltration, water retention, salinity, soil quality, crop yield and irrigation water productivity (IWP) to identify the optimal rate. Phosphogypsum application altered pore structure and water potential gradients, slowing wetting front migration, increasing infiltration duration (102 to 158 min), cumulative infiltration (17.37 to 27.44 cm) (p < 0.05) and soil water content (18.25% to 24.33%) (p < 0.05) as the rate increased from CK to 0.6%. It also enhanced water retention by enhancing soil aggregation and reducing evaporation.By promoting the formation and stabilization of soil aggregates, phosphogypsum application (CK to 0.6%) reduced bulk density from 1.20 g/cm3 to 1.12 g/cm3 (p < 0.05), while porosity, available nitrogen and urease activity increased by 3.70%, 39.42% and 82.61%, respectively (p < 0.05). These enhancements provided a strong foundation for improved crop performance. Specifically, phosphogypsum enhanced yield through three pathways: (1) improving soil physical properties, which influenced soil nutrients and then improved enzyme activities; (2) directly affecting soil nutrients, which impacted enzyme activities and increased yield; and (3) directly boosting enzyme activities, leading to increased yield. The comprehensive benefits of phosphogypsum initially increased and then decreased, with an optimal application rate of 0.45% determined through TOPSIS, a method that ranks alternatives based on their proximity to an ideal solution, considering factors including soil quality, crop yield and IWP. These findings confirm the feasibility of phosphogypsum as an effective resource to enhance water efficiency and soil quality, promoting sustainable agricultural practices.