Postmenopausal osteoporosis is associated with bone formation inhibition mediated by the impaired osteogenic differentiation potential of bone marrow mesenchymal stem cells (BMSCs). However, identifying and confirming the essential genes in the osteogenic differentiation of BMSCs and osteoporosis remain challenging. The study aimed at revealing the key gene that regulated osteogenic differentiation of BMSCs and led to osteoporosis, thus exploring its therapeutic effect in osteoporosis. In the present study, six essential genes related to the osteogenic differentiation of BMSCs and osteoporosis were identified, namely, fibrillin 2 (Fbn2), leucine‐rich repeat‐containing 17 (Lrrc17), heat shock protein b7 (Hspb7), high mobility group AT‐hook 1 (Hmga1), nexilin F‐actin‐binding protein (Nexn), and endothelial cell‐specific molecule 1 (Esm1). Furthermore, the in vivo and in vitro experiments showed that Hmga1 expression was increased during the osteogenic differentiation of rat BMSCs, while Hmga1 expression was decreased in the bone tissue of ovariectomized (OVX) rats. Moreover, the expression of osteogenic differentiation‐related genes, the activity of alkaline phosphatase (ALP), and the number of mineralized nodules were increased after Hmga1 overexpression, which was partially reversed by a Wnt signaling inhibitor (DKK1). In addition, after injecting Hmga1‐overexpressing lentivirus into the bone marrow cavity of OVX rats, the bone loss, and osteogenic differentiation inhibition of BMSCs in OVX rats were partially reversed, while osteoclast differentiation promotion of BMSCs in OVX rats was unaffected. Taken together, the present study confirms that Hmga1 prevents OVX‐induced bone loss by the Wnt signaling pathway and reveals that Hmga1 is a potential gene therapeutic target for postmenopausal osteoporosis.