This study employs machine learning analysis with population data for the associations of preterm birth (PTB) with temporomandibular disorder (TMD) and gastrointestinal diseases. The source of the population-based retrospective cohort was Korea National Health Insurance claims for 489,893 primiparous women with delivery at the age of 25–40 in 2017. The dependent variable was PTB in 2017. Twenty-one predictors were included, i.e., demographic, socioeconomic, disease and medication information during 2002–2016. Random forest variable importance was derived for finding important predictors of PTB and evaluating its associations with the predictors including TMD and gastroesophageal reflux disease (GERD). Shapley Additive Explanation (SHAP) values were calculated to analyze the directions of these associations. The random forest with oversampling registered a much higher area under the receiver-operating-characteristic curve compared to logistic regression with oversampling, i.e., 79.3% vs. 53.1%. According to random forest variable importance values and rankings, PTB has strong associations with low socioeconomic status, GERD, age, infertility, irritable bowel syndrome, diabetes, TMD, salivary gland disease, hypertension, tricyclic antidepressant and benzodiazepine. In terms of max SHAP values, these associations were positive, e.g., low socioeconomic status (0.29), age (0.21), GERD (0.27) and TMD (0.23). The inclusion of low socioeconomic status, age, GERD or TMD into the random forest will increase the probability of PTB by 0.29, 0.21, 0.27 or 0.23. A cutting-edge approach of explainable artificial intelligence highlights the strong associations of preterm birth with temporomandibular disorder, gastrointestinal diseases and antidepressant medication. Close surveillance is needed for pregnant women regarding these multiple risks at the same time.