Objective: To assess the effectiveness and safety of canagliflozin in the management of ST segment elevation myocardial infarction (STEMI) patients with type 2 diabetes mellitus (T2DM) post-percutaneous coronary intervention (PCI). Methods: A retrospective analysis on data of patients diagnosed with STEMI and T2DM who underwent PCI treatment at our hospital was performed from June 2020 to September 2023. The patients were divided into two groups based on the exposure factor: the canagliflozin and conventional treatment groups and the canagliflozin and routine treatment groups. Various parameters, such as demographic characteristics, cardiac function indicators, and insulin-related factors, were collected and compared postprocedure. In addition, evaluation of the insulin sensitivity index (ISI), lipid profile parameters, and safety outcomes was conducted. A balanced baseline characteristics of patients was achieved via propensity score matching (PSM) at a 1:1 ratio. Statistical analyses were performed through t-tests, nonparametric tests, and chi-square tests. Results: This work included data on 156 patients, including 63 and 93 patients in the canagliflozin and routine treatment groups, respectively. Later, each group comprised 63 patients after 1:1 matching by PSM. After treatment, the canagliflozin treatment group exhibited notably reduced levels of N-terminal B-type natriuretic peptide, cardiac troponin T (cTnT), and creatine kinase-MB and a significantly higher level of left ventricular ejection fraction in comparison with the routine treatment group (p < 0.05). In addition, following treatment, the canagliflozin treatment group exhibited a significant decrease in homeostatic model assessment (HOMA)-insulin resistance levels and a significant increase in HOMA-β levels (p < 0.05). Conversely, the groups manifested no significant variances in terms of major adverse cardiovascular events, hypoglycemia, diabetic ketoacidosis, acute kidney injury, and urinary tract infection (p > 0.05). Conclusion: The concurrent administration of canagliflozin following PCI improves cardiac function, insulin sensitivity, and lipid profile in patients with STEMI and T2DM, which ultimately lowers the likelihood of cardiovascular incidents. Canagliflozin demonstrates favorable clinical safety profiles in such individuals and displays promising prospects for clinical utility.