Any student found to have formed, or to belong to, an organisation, society, team, group or club that has not been approved by the High Inquisitor will be expelled.
The above is in accordance with Educational Decree Number Twenty-four.
-- Umbridge (OP17)
In Harry’s fifth year, Dolores Umbridge became High Inquisitor of Hogwarts, and the Ministry decreed: “No student organisations, societies, teams, groups and clubs may exist without the knowledge and approval of the high Inquisitor” (OP17). Headmaster Snape reinstated it in 1997 to stop Dumbledore’s Army from reforming, although Neville managed to secretly get the members back together again in the Room of Requirement before the Battle of Hogwarts (DH16, DH29).
Marietta Edgecombe was the member of Dumbledore's Army who snitched on them to Umbridge, telling her to look in the Room of Requirement for evidence (OP22) One of the Inquisitorial Squad members, Pansy Parkinson, entered the Room and found the list of Army members. Also, a wizard named Willy Widdershins made a plea deal with the Ministry after getting arrested for making exploding toilets, and testified to being present at the Hog's Head tavern during the first meeting of Dumbledore's Army (OP22, OP27).
Harry thought he was going to be expelled or arrested, but Dumbledore covered for him, telling Fudge and Umbridge that the group was his idea, just before he grabbed Fawkes the Phoenix and fled his office "in style" to escape the Aurors. Umbridge was then made Headmistress of Hogwarts, and the Weasley Twins escalated her problems with their portable swamp and fireworks, and the teachers refused to help her (OP29,OP30). The Decree was abolished when Dumbledore returned to the school after the Battle for the Department of Mysteries,
In seventh year when Harry was on the run, Neville kept Dumbledore's Army alive in the Room of Requirement in spite of the Carrows who believed in using the Cruciatus Curse as punishment (DH28, DH29). Headmaster Snape outwardly reinstated Educational Decree Twenty-four to keep students from congregating together, he was also playing the role of double spy and fighting against the Carrows. When Neville, Ginny and Luna were caught trying to steal the Sword of Gryffindor from the Headmaster's Office, he didn't send them to the dungeons to be tortured, or grill them with Veritaserum about other members of Dumbledore's Army (as Umbridge would have done). Instead, he sent them to the Forbidden Forest to spend the evening with Hagrid, a detention Neville had experienced as a first year student, and where Harry's friends would stay blessedly unharmed (DH15).
Dumbledore's Army can be viewed as the student equivalent of the Order of the Phoenix. While Harry and the others were sneaking around behind Umbridge's back, the adults were being just as sneaky with both Umbridge and the Ministry in general until Dumbledore could gain control of Hogwarts again.