The Ahl al-Dhimma are permitted to worship according to their religion, because peace has been made with them on the condition of paying Jizyah and not on the condition of abandoning their religion.
قاتلوا ... حتى يعطوا الجزية
Fight ... until they give the jizyah
— Quran 9:29
فإن هم أبوا فسلهم الجزية فإن هم أجابوك فاقبل منهم وكف عنهم