Patient selection is extremely important in obstructed defecation syndrome (ODS) and rectal prolapse (RP) surgery. This study assessed factors that guided the indications for ODS and RP surgery and their specific role in our decision-making process using a machine learning approach. This is a retrospective analysis of a long-term prospective observational study on female patients reporting symptoms of ODS who underwent a complete diagnostic workup from January 2010 to December 2021 at an academic tertiary referral center. Clinical, defecographic, and other functional tests data were assessed. A supervised machine learning algorithm using a classification tree model was performed and tested. A total of 400 patients were included. The factors associated with a significantly higher probability of undergoing surgery were follows: as symptoms, perineal splinting, anal or vaginal self-digitations, sensation of external RP, episodes of fecal incontinence and soiling; as physical examination features, evidence of internal and external RP, rectocele, enterocele, or anterior/middle pelvic organs prolapse; as defecographic findings, intra-anal and external RP, rectocele, incomplete rectocele emptying, enterocele, cystocele, and colpo-hysterocele. Surgery was less indicated in patients with dyssynergia, severe anxiety and depression. All these factors were included in a supervised machine learning algorithm. The model showed high accuracy on the test dataset (79%, p < 0.001). Symptoms assessment and physical examination proved to be fundamental, but other functional tests should also be considered. By adopting a machine learning model in further ODS and RP centers, indications for surgery could be more easily and reliably identified and shared.