It's possible to side with Father Flynn, viewing him as an innocent man whose actions are willfully misinterpreted as evildoing. At the same time, the history of systemic abuse in the Catholic Church shows that Sister Aloysius has a point — priests have a position of power over their pupils, and rigidly supervising such relationships is a valid way to make sure there's no room in them for abuse. In that way, Aloysius' final cry of "I have such doubts!" can be taken as a meta-reflection of the audience's undecided state of mind.

But why does she suddenly have doubts, after spending the whole film certain of Flynn's guilt? The answer is that Aloysius is a human being herself and unable to fully uphold the Church's discipline. Early on, she's seen hiding the elderly Sister Veronica (Alice Drummond)'s blindness from the rest of the parish so that Veronica won't be thrown out of the convent. Despite her professed moral clarity, Aloysius understands the appeal of modernity, with all its flexibility and room for emotion. She knows Father Flynn might be right, and that the Church might need to change.

For most of the story, she's able to ignore that doubt. However, the senior clergymen, the traditional Church structure Aloysius is so bound to, rewards Flynn. It's a moral ultimatum: Either Aloysius respects the senior clergy's actions, in which case she has to admit that her view of Flynn is incorrect, or she holds fast to her belief in Flynn's guilt and confronts the fact that the Church's entire operation might be warped and corrupted, possibly for a long time. 

Either way, she loses something. Her personal faith is no longer reconcilable with her practice as a nun. And that's where Doubt ends, because the conflict has become too big for any one movie to resolve.