The flatness of the KH2PO4 (KDP) crystal has important effect on the inertial confinement fusion system. The method to improve the flatness of KDP crystal and its implementation in the machine tool design is presented in this paper. The finite element model of the whole machine tool is built up to describe the tool tip displacement with the cutting force along the cutting path. The influence of the axial and radial bearing stiffness of the aerostatic spindle on the machined surface flatness is discussed. Furthermore, a novel adjusting mechanism which is used to adjust the squareness between the spindle and the slide is designed, and a new machining process is proposed to improve the flatness of the machined surface. The machining trials are carried out to evaluate and validate the effectiveness of the presented approach and simulation.