The present invention relates to the technical field of immunotherapy of infectious diseases, in particular to construction and application of a recombinant gene for chimeric antigen receptor (CAR) for treating HIV infection. The present invention provides a single-chain antibody ScFv capable of recognizing gp120 on the surface of an HIV virus-infected cell, which is obtained by tandemly ligating light chain and heavy chain variable regions of an antibody against gp120 on the surface of the HIV virus-infected cell; the single-chain antibody is made into a chimeric antigen receptor (CAR), the CAR encoding gene is transferred into a plasmid vector, and the lentiviral vector into which the CAR encoding gene is transduced is transduced into CD8T lymphocytes. The obtained CAR-T lymphocytes have been found to have significant activity in inhibiting and killing HIV-infected cells in both in vitro and in vivo experiments, which can be used as an active ingredient for preparing a drug against HIV infection, thereby having a good application prospect.