The Shuffled Complex Evolution—University of Arizona (SCE-UA) is a classical algorithm in the field of hydrology and water resources, but it cannot solve constrained optimization problems directly. Using penalty functions has been the preferred method to handle constraints, but the appropriate selection of penalty parameters and penalty functions can be challenging. To enhance the universality of the SCE-UA, we propose the Constrained Shuffled Complex Evolution Algorithm (CSCE) to conveniently and effectively solve inequality-constrained optimization problems. Its performance is compared with the SCE-UA using the adaptive penalty function (SCEA) on 14 test problems with inequality constraints. It is further compared with seven other algorithms on two test problems with low success rates. To demonstrate its effect in hydrologic model calibration, the CSCE is applied to the parameter optimization of the Xinanjiang (XAJ) model under synthetic data and observed data. The results indicate that the CSCE is more advantageous than the SCEA in terms of the success rate, stability, feasible rate, and convergence speed. It can guarantee the feasibility of the solution and avoid the problem of deep soil tension water capacity (WDM)<0 in the optimization process of the XAJ model. In the case of synthetic data, the CSCE can accurately find the theoretical optimal parameters of the XAJ model under the given constraints. In the case of observed data, the XAJ model optimized by the CSCE can effectively simulate the hourly rainfall-runoff events of the Hexi Basin and achieves mean Nash efficiency coefficients greater than 0.75 in the calibration period and the validation period.