Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” in the Registration Statement (Form S-3) and related Prospectus of Molecular Templates, Inc. for the registration of 1,209,612 shares of common stock, 2,460,559 shares of common stock issuable upon the exercise of prefunded warrants, and 7,340,342 shares of common stock issuable upon the exercise of common stock warrants and to the incorporation by reference therein of our report dated March 29, 2024, with respect to the consolidated financial statements of Molecular Templates, Inc. included in its Annual Report (Form 10-K) for the year ended December 31, 2023, filed with the Securities and Exchange Commission.

/s/ Ernst & Young LLP

Austin, Texas

April 25, 2024