TianQin is a planned Chinese space-based gravitational wave (GW) observatory with a frequency band of 10-4 to 1Hz. Optical telescopes are essential for the delivery of the measurement beam to support a precise distance measurement between pairs of proof masses. As the design is driven by the interferometric displacement sensitivity requirements, the stability control of optical path length (OPL) is extremely important beyond the traditional requirement of diffraction-limited imaging quality. In a telescope system, the recurring tilt-to-length (TTL) coupling noise arises from the OPL variation due to the wavefront deformation and angular misalignment. Reducing the residual chief ray aberration in the optical design helps suppress TTL coupling noise. To correct the pupil aberrations, we derive primary pupil aberrations in a series expansion form, and then refine the formulation of merit function by combining the pupil aberration theory and traditional image aberration theory. The automatic correction of pupil aberrations is carried out by using the macro programming in the commercial optical software Zemax, leading to a high performance telescope design. The design results show that on one side the pupil aberrations have been corrected, and on the other side, its optical performance meets the requirements for TianQin project. The RMS wavefront error over the science field of view (FOV) is less than λ/200 and the maximum TTL coupling noise over the entire ±300 μrad FOV is 0.0034nm/µrad. We believe that our design approach can be a good guide for the space telescope design in any other space-based GW detection project, as well as other similar optical systems.