James87 - Part of me feels like I have failed and a part of me feels relieved and lucky that I didn't marry her.
2 years ago I used to look at relationships the same way you do—that it's either a success or a failure. If a couple breaks up, it's because they failed at keeping that relationship alive. I no longer share that belief. Today, I prefer to look at it differently*. If a couple breaks up, it's not because they failed. It's because they found out more about each other—and that new information has led them (or one of them) to conclude that they are incompatible.
Incompatibility in a relationship doesn't mean failure. No matter what you do in life you have high chances of meeting someone, falling in love with him/her, and then finding out that, after all, the two (or more) of you are incompatible with each other. This may be because one partner wants kids while the other doesn't. Or because one partner has higher sex drive than the other. Or because one partner is overly religious (to the point of being "batshit crazy") while the other isn't. Or because... (insert any important reason.)
The reason why I don't look at it as a failure is because failing implies having done something wrong. If you have not done this thing wrong, then you would not have failed. But it's not true when it comes to incompatibility. No matter what you do sometimes compromise is not possible. In your case, your girlfriend (soon-to-be ex, I assume) is not only too religious, but she is also fickle and capricious. These two character traits make the two of you incompatible. You have not failed because no matter what you would have done in the past this would not change. She would still be religious, fickle, and capricious. Your personalities are simply incompatible.
* This is not to say that there is no such thing as failure in relationships. For example, if you are abusing your partner, you are obviously failing. However, my point is that incompatibility does not necessitate failure.