You haven't said which location (although there is good reason to assume it is somewhere in the USA, and I might even guess the state). If it is a position where your religion is essential, like a religious teacher or a priest, it would be legal. For an accountant, probably not. But this is all missing the point, because legal questions are off-topic here.
On the other hand, what are you going to do? Personally, I wouldn't want that job at all, no matter what the job is. If they don't agree with my religion or lack thereof, they can keep their job. (That's the polite version). You can probably go to court about it, you might even win, but it would be a waste of your time and money. So best for you to just ignore it.