This paper proposes a smoothness optimization method of horizontal alignment based on orthogonal least squares and the theory of controlling the track smoothness. With this method, multiple curve types can be fitted simultaneously according to the maintenance requirements, and the residual deviation in the track is optimized according to the smoothness standard. The target alignment of the tamping operation is constructed, providing support for the maintenance of the ballasted track. The implementation results show that the proposed method fully adapts to operating railway maintenance conditions, and the optimized design parameters resemble the field observation results. The lateral profile track quality index is reduced from 0.78 to 0.39, the amplitudes of the 10 and 60 m mid‐chord offset decrease by 73% and 52%, respectively, and the 30‐m vector distance difference decreased by 53%, indicating effective improvement.