1 Cersei was arrested for her Sins
Cersei was arrested by the Sparrows for his sins which include Incest and adultery.
2 Lancel Lannister told her secrets
Lancel Lannister became a devoted sparrow. He told the Sparrows about Cersei's relationship with Jaime and her past relationship with him.
3 The Sparrows were empowered
The Sparrows were empowered, given weapons and allowed to take people prisoners if they had faith problems. Cersei was the one who empowered them yet they threw her in jail. See also why Cersei hates Tyrion.
4 The Sparrows don't recognize authority
The Sparrows don't recognize any authority. To them all people are considered equal in front of God.
5 King Tommen didn't want to shed blood
King Tommen didn't want his men to attack the Sparrows. So both Cersei and Margaery remained in jail for sometime.
6 Kevan Lannister didn't want to meet Cersei
Kevan Lannister Knew that Cersei is in jail but didn't want to visit her. See also summary of Episode 8 season 5.
7 Cersei refused to confess
Cersei was given the option on daily basis to confess for her sins and get released. Cersei refused to confess. See also why Tywin hated Tyrion.
8 King Tommen got depressed and isolated
King Tommen got depressed and isolated. He didn't know what to do and he remained in his room. This allowed the Sparrows to keep Cersei jailed.
9 Cersei had no real friends outside
Because of the way she used to deal with people Cersei had few friends outside who were willing to save her from prison.