By the time that Mary Warren, in act three, comes forth with her testimony that the girls have been faking, there are numerous people in the jails, being condemned as witches, based on the testimony of these same girls. Danforth is a might judge, brought in from the outside, and he has a reputation to maintain. If it is found that he condemned innocent people to die, based on the antics and acting of a bunch of little girls, his career will be ruined. He will be a laughing-stock, a joke of a judge, and no one will ever trust his judging capabilities ever again. To have been fooled by little girls, and to condemn innocent people to death based on those same little girls! What a mockery, and a shame! So, Danforth has quite a bit of stake in maintaining the courts as they are, and keeping the people he has already condemned in the jails.
Mary's testimony, if true, undermines his entire authority as a judge, and makes him look the fool. So, he is quick to side against Mary, quick to believe Abigail and her posse, rather than ruin his career and reputation for believing the quavering Mary Warren. I hope that those thoughts help to clear the situation a bit for you; good luck!
juice monkey huyeeeeeah