Elizabeth fires Abigail because she knows that the girl and her husband were having an affair. It is the source of all the trouble that brews in Salem. In exchange for being fired, Abigail and the girls dance naked in the woods, while she drinks a potion concocted by Tituba as an attempt to "remove" Elizabeth so that she can be with John Proctor.
It is shared early on in the drama that Abigail bears resentment for being "sent out" by Elizabeth. She says so the first moment she and John are alone in the second scene of the first Act:
I know how you clutched my back behind your house and sweated like a stallion whenever I come near! Or did I dream that? It's she [Elizabeth] put me out, you cannot pretend it were you. I saw your face when she put me out, and you loved then and you do now!
There is resentment that Abigail feels for being fired by Elizabeth. However, it is clear that there was an affair between the both of them. In this, Elizabeth acts in the name of her marriage.
We get some level of insight in to Elizabeth's motivation for firing Abigail from her own words. In the first scene of Act II, it is alluded that she knew of the relationship and the feelings that John harbored for the girl and might still. When she suggests that "the magistrate" in John's heart "sits in judgment," we get the idea that the firing was needed in order to begin the process of moral reconciliation, something that is still ongoing in the early phases of the drama.
The courtroom scene of Act III brings us the most direct words from Elizabeth as to why she had to fire Abigail. She is summoned at the point where Proctor has confessed to his adultery with Abigail, in the attempt to discredit her and the accusations that have escalated to an out of control condition. Danforth "forces" her to disclose the reason why Abigail was fired:
Danforth: Why did you dismiss Abigail Williams?
Elizabeth: She dissatisfied me. (Pause) And my husband.
Danforth: In what way dissatisfied you?
Elizabeth: She were...Your honor, I- in that time I was sick. And I- My husband is a good and righteous man. He is never drunk as some are, nor wastin' his time at the shovelboard, but always at his work. But in my sickness- you see, sir, I were a long time sick after my last bby, and I thought I saw my husband somewhat turning from me. And this girl- (She turns to Abigail.)
This is the closes that Elizabeth comes from admitting that the reason for the dismissal was because of the affair. It is at this critical moment, her "crucible" as it were, does Elizabeth turn from the truth and lie in court that her husband did not have an affair, something that he already confessed in public. Demonstrating how a corrupt legal system can hardly be trusted in finding the truth, Elizabeth's real reason for dismissing Abigail was for the affair with her husband remains in her heart and is not spoken into the legal record.