Xanthan gum (XG) is one of the widely used biopolymers in oilfield development. It has low cost and will not pollute the environment. However, its limited temperature and salt tolerance restricts its application in high temperature and high salt reservoirs. An environmentally friendly hydrophobic associative polymer was prepared by grafting long-chain alkyl groups onto xanthan gum through an etherification reaction for enhanced oil recovery (EOR). The hydrophobically modified xanthan gum (MXG) was characterized by Fourier transform infrared spectroscopy (FT-IR), nuclear magnetic resonance spectroscopy (NMR), gel permeation chromatography (GPC), and thermogravimetric analysis (TGA). Due to the hydrophobic association, MXG had excellent thickening, rheological properties, antiaging, temperature, and salt resistance properties. In the 30 g/L NaCl solutions, the viscosity of MXG (335 mPa s) was about 3 times that of XG (115.3 mPa s) at 65 °C. Whether in a high-salt solution (20 g/L NaCl) or reservoir injection water (mineralization of water is 7542 mg/L), modified xanthan gum can show good antiaging properties. The polymer flooding experiments showed that EOR of MXG is 25%, 7% higher than that of XG. The macroscopic mechanism of MXG flooding was studied. In summary, MXG has a wide range of applications in EOR.