Should it legally?
I don't see why not...nations are so various, and the idea of a nation itself implies certain exchanges and forfeitures of rights, so sayeth Hobbes and Locke and Rousseau and a bunch of other Smart Dead White Guys. Short of outright killing or mutilating its own citizens or those of other countries, determining universals when it comes to what should and shouldn't be allowed in a state is pretty tricky.
Now, should it be morally/ethically/would *I* want a state based on religion?
No. Christian states have committed atrocities fueled by Christianity, and the same can be said of Judaism, Islam, and just about any religion. (I WOULD specify the difference between a Judaic and Jewish state...since again, being Jewish is/can be both a religious AND ethic/cultural thing, so where I don't like/don't want Israel to become the former, a "Judaic" state, I'd be fine with it identifying as a Jewish state in terms of ethnicity and culture. I don't want it to exclude people on THAT basis either--though Bibi will, because I think he, Abbas, and Hamas leadership have a bet to see who can come across as the biggest cartoonish villain--but again, Jewish over Judaic, and cultural over religious when it comes to a state.)