In the design of the Computed Tomographic Imaging Spectrometer (CTIS), in order to optimize the holographic grating and achieve better design performance, this paper proposes a novel optimization algorithm based on the Gerchberg–Saxton (GS) iterative algorithm. This algorithm combines the weighted GS algorithm with the interior point method (IPM). By introducing weight factors for phase and amplitude in the optimization process of the GS algorithm, and incorporating the actual diffraction characteristics of the holographic grating obtained from the Computer Simulation Technology Studio Suite into the IPM optimization process, a more optimized design performance is achieved. Using this algorithm, a metasurface holographic grating is designed, which can transform the input parallel light into a dispersion image of 25 diffraction orders on a focal plane array. The transmission efficiency exceeds 72%, and the root mean square error between different diffraction orders is less than 0.1. Among them, the optimization time is shortened by approximately 70% due to a significant reduction in the number of independent variables through symmetry. Through comparison, this method can further improve the uniformity of energy distribution based on the original algorithm, avoid being trapped in local extreme values, and thus enhance the overall design quality of the CTIS.