Sustainable agricultural planning in Nigeria requires balancing profitability, water use, and food security under climatic uncertainty. This study developed and validated a multi-objective optimization framework integrating particle swarm optimization (PSO) and random forest (RF) regression to improve crop allocation and resource management. Agricultural planning was formulated around three competing objectives: profit maximization, water-use minimization, and caloric production maximization. Six algorithms, including linear programming, integer linear programming, genetic algorithm, PSO, ant colony optimization, and the proposed hybrid PSO-RF framework, were implemented in Python and evaluated using agricultural, climatic, and soil data from three Nigerian agro-ecological zones. The RF yield predictor achieved a weighted-mean coefficient of determination ($R^2$) of 0.968, a root mean square error (RMSE) of 373.4 kg/ha, and a mean absolute error (MAE) of 284.2 kg/ha, with an average prediction error of 6.8% of mean yield. The hybrid PSO-RF framework achieved the highest optimality (97.1%) among the evaluated methods under the common evaluation benchmark. In a 1,000-ha case study in Southwest Nigeria, the optimized allocation generated an annual profit of $\text{₦}$1.4525 billion and caloric production of $13.526 \times 10^9$ kcal, meeting approximately 296% of the annual caloric requirement of 5,000 persons (a 196% surplus above the minimum requirement). Water-use efficiency was 1.93 kg/m$^3$. The reported caloric production and food-security indicators were calculated directly from the optimized crop outputs using the corresponding crop-specific caloric conversion factors, ensuring consistency with the optimization results. Under the 2050 climate scenario (+2 $^\circ\mathrm{C}$ and $-15\%$ rainfall), annual profit declined to $\text{₦}$1.163 billion, while adaptive crop reallocation maintained caloric production above the minimum food-security requirement. A web-based decision support system was developed to translate the optimization results into a practical planning tool for policymakers, farmer cooperatives, and agricultural extension services.