Microinertial sensors currently cannot provide long-term stability attitude information for a spinning projectile because of drift error. An attitude measuring method of a spinning projectile based on the background magnetic field (BMF) compensation is presented. The effect of the BMF is discussed, with particular attention to its implications for magnetometer-based attitude measuring. First, a compensation model of the BMF is established. Then, the error in measuring attitude caused by the BMF is analyzed using a theoretical model and numerical simulation. An attitude measuring algorithm for the spinning projectile based on the intersection ratio of magnetic sensors is proposed. Finally, semiphysical experiments are carried out to prove the effectiveness of this attitude measurement method. The experiment results indicate that the error of attitude angles is within and the attitude angle error of the combined magnetic sensors is not cumulated. Compared with the traditional geomagnetic attitude measurement method, the accuracy of our method is improved, which can be used for the trajectory correction of simple guided ammunition.