Millimeter wave (mmWave) communications of unmanned aerial vehicles (UAVs) have drawn dramatic attentions for its flexibility on a variety of applications. Recently, channel tracking base on the spatial features has been proposed to solve the problem of beam misalignments due to the UAV navigation. However, unstable beam pointing caused by the non-ideal beam tracking environment may impact the performance of mmWave systems significantly. In this paper, an improved beamforming method is presented to overcome this shortcoming. Firstly, the effect of the beam deviation is analyzed through the establishment of the equivalent data rate. Then, combining the quantification of spatial angle and the improved orthogonal matching pursuit (OMP) algorithm, an optimized beam corresponding to the beam deviation is obtained. Simulation results show that the optimized beam of the proposed approach can effectively improve the spectral efficiency without improving the complexity when the beam pointing is unstable.