The high susceptibility of raspberries to softening restricts the development of the raspberry industry. The primary causes of fruit softening are the breakdown of components linked to the cell wall and the destruction of the cell wall structure itself. Polygalacturonase (PG), a key enzyme that catalyzes pectin degradation, plays a critical role in fruit softening. However, there are currently limited studies on the mechanism of PG genes in raspberry fruit softening. In this study, a PG gene, RiPG2, was isolated from raspberry (Rubus idaeus L.). ‘Polka’ fruits and tomato plants overexpressing RiPG2 were obtained by Agrobacterium tumefaciens-mediated leaf disc transformation to elucidate the role of RiPG2 in fruit softening. The total length of the RiPG2 gene is 1185 bp, and the gene encodes a total of 394 amino acids. The GFP fusion protein was expressed at the chloroplast under laser confocal microscopy, indicating that the RiPG2 protein is localized to the chloroplasts. Phenotypic analysis revealed that the fruit firmness of three strains was considerably less than that of controls, but PG enzyme activity was increased. Overexpression of RiPG2 altered the content of cell wall components, with an increase in water-soluble pectin (WSP) and ion-bound pectin (ISP) but a decrease in protopectin, cellulose, hemicellulose, and covalently bound pectin (CSP). In addition, RiPG2 positively regulated the expression of cell wall metabolism-related genes such as SlEXP1, SlTBG4, SlXTH5, and SlPL. These results suggest that the RiPG2 gene regulates the structure and composition of the cell wall and acts synergistically with other cell wall metabolism-related genes to promote fruit softening. This study provides a new candidate gene for molecular breeding to improve raspberry firmness.