I'd be interested in your source for this. While you may say that the Queen of the UK (and Canada etc.) is purely ceremonial, she most certainly does have to be Anglican. And I think there's no question the head of the Vatican does have to be Roman Catholic!
There is 19 countries where ceremonial monarch must be christian. UK is one of them, but as far as I know Vatican is not. There is no any law that pope should be Roman Catholic or even member of any christian church. Naturally he always is. Pope must be man and I guess he must be baptized and confirmand.