Steroid-induced osteonecrosis of the femoral head (SONFH) is a prevalent form of osteonecrosis in young individuals. More efficacious clinical strategies must be used to prevent and treat this condition. One of the mechanisms through which SONFH operates is the disruption of normal differentiation in bone marrow adipocytes and osteoblasts due to prolonged and extensive use of glucocorticoids (GCs). In vitro, it was observed that atorvastatin (ATO) effectively suppressed the impact of dexamethasone (DEX) on bone marrow mesenchymal stem cells (BMSCs), specifically by augmenting their lipogenic differentiation while impeding their osteogenic differentiation. To investigate the underlying mechanisms further, we conducted transcriptome sequencing of BMSCs subjected to different treatments, leading to the identification of Wnt5a as a crucial gene regulated by ATO. The analyses showed that ATO exhibited the ability to enhance the expression of Wnt5a and modulate the MAPK pathway while regulating the Wnt canonical signaling pathway via the WNT5A/LRP5 pathway. Our experimental findings provide further evidence that the combined treatment of ATO and DEX effectively mitigates the effects of DEX, resulting in the upregulation of osteogenic genes (Runx2, Alpl, Tnfrsf11b, Ctnnb1, Col1a) and the downregulation of adipogenic genes (Pparg, Cebpb, Lpl), meanwhile leading to the upregulation of Wnt5a expression. So, this study offers valuable insights into the potential mechanism by which ATO can be utilized in the prevention of SONFH, thereby holding significant implications for the prevention and treatment of SONFH in clinical settings.