The terror begins with Georges Danton who said “Let us be terrible so that the people don’t have to be”. What Danton was expressing is a term known as . Basically in 1792, there was strong popular agitation and paranoia against suspected counter-revolutionaries, you had the September Massacres where the Parisian Mob, in fear of defeat massacred 1200 prisoners in 3 days, resorting to summary executions and mock trials. Danton as Minister of Justice was either unable or unwilling to prevent this violence, because the Revolutionary Government depended on such popular revolutionary fervor as indications of loyalty and support.
Instead Danton decided to create government institutions to better police and effect this violence. He started the Revolutionary Tribunals and later he would sit on the chairs of the Committee of Public Safety, two whole months before Robespierre took office. The idea was that people are going to be accused and killed for being counter-revolutionaries anyway, but we can limit the number of people who die and establish control over the popular revolutionaries by instituting their ideas from above.
So that was the justification of the Terror. And this by the way had partisan consensus: moderates, extreme leftists, some Girondins (who were the first to use the tribunal against a political suspect, Marat) and so on.
France remember had no liberal tradition, the justice system before the Revolution was a joke, murdering more people in a single year than the Terror did. When the Revolutionaries came in, they had to build institutions but they did so in an environment hostile within and hostile without, made worse thanks to Girondin incompetence and royalist treachery. So they resorted to ad-hoc compromises to both save their skin and maintain any kind of order they could.