the AI cares more about what religion a player is than a human player would.
One of the possible solutions to this would be to tie the importance of another civ's religion to each AI to their own religion civic - i.e. it's unimportant for civs that have Free Religion, and gets increasingly important with Pacifism, Paganism, State Religion and Theocracy. That would make religion's effects much more variable - the possibility of religious wars wouldn't be gone completely, but they wouldn't be inevitable.