In compressive spectral imaging, three-dimensional spatio-spectral data cubes are recovered from two-dimensional projections. The quality of the compressive-sensing-based reconstruction is dependent on the coherence of the sensing matrix, which is determined by the system projection and the sparse prior. Studies on the optimization of the system projection, which mainly deals with the coded aperture, successfully decreases the coherence of the sensing matrix and improves the reconstruction quality. However, the optimization of the sparse prior considering the relationship between the system projection and the sparse prior remains a challenge. In this paper, we propose a gradient-descent-based sparse prior optimization algorithm for the coherence minimization of the sensing matrix in compressive spectral imaging. The Frobenius norm coherence is introduced as the cost function for the optimization, and the overcomplete dictionary is chosen as the sparse prior to solve the optimal sparse representation in the reconstruction as it provides higher degree of freedom for optimization compared to common orthogonal bases. The optimized dictionary effectively decreases the coherence of the sensing matrix from 0.880 to 0.604 and significantly improves the quantitative image quality metrics of the reconstructed hyperspectral images with the corresponding peak signal-to-noise ratio (PSNR) increased by 9 dB, the structural similarity (SSIM) above 0.98, and the spectrum angular mapper (SAM) below 0.1. Furthermore, the requirement of the sampling snapshots is reduced, which is shown by similar image quality metrics between the reconstructed hyperspectral images of only 1 snapshot with the optimized dictionary and of more than 5 snapshots with the non-optimized dictionary.