The forced confessions and subsequent show trials implemented by Napoleon are all part of his efforts to consolidate his power.
As has become blindingly obvious to just about everyone on the farm, Napoleon is not much good as a leader. Lazy, brutal, and incompetent, he has tarnished the ideals of Animalism as set down by Old Major, and, despite his elaborate promises, he has not greatly improved the animals' condition.
So in order to cement his grip on power, Napoleon starts casting around for scapegoats to explain the many things that have gone wrong on the farm. Before long, animals are being accused of all kinds of serious crimes, such as deliberate sabotage and collusion with Snowball, the hero of the Battle of the Cowshed who's now the regime's Public Enemy Number One.
The charges made against the animals are completely ridiculous and without foundation. But even so, many of them confess to their so-called crimes. This is mainly for two reasons. First and foremost, they have been coerced into giving confessions. Second, they believe that if they confess, they'll receive more lenient treatment.
In the event, however, such leniency is not forthcoming, and those animals who confess are mercilessly slaughtered at Napoleon's behest.