To protect the Republic and ensure peace and justice
According to the canonical Star Wars Databank:
A noble order of protectors unified by their ability to tap into the
power of the Force, the Jedi Order were the guardians of peace and
justice in the Galactic Republic.
So the Jedi are dedicated to preserving peace, harmony, and justice in the Galactic Republic. This is why, for example, they cracked down on the slave trade:
For thousands of years, Zygerria supplied slave labor the the galaxy;
the Zygerrian Slave Empire became wealthy and powerful, as did those
who exploited their chained subjects. After the Jedi Knights cracked
down on the slave trade, Zygerria diminished.
The goals of the Jedi generally derive from their moral philosophy:
There is no emotion, there is peace.
There is no ignorance, there is knowledge.
There is no passion, there is serenity.
There is no chaos, there is harmony.
There is no death, there is the Force.
Indeed, the Clone Wars can be seen as the events that led to the Jedi abandoning their philosophy, by engaging in constant war, accepting an army of semi-enslaved clones, and so forth.
It’s important to understand that the heavy involvement of the Jedi in the war came from these general principles, and not from any ideological conflict. They are not subservient to the Senate (though they are subject to the laws of the Galactic Republic). From the perspective of the Jedi Order, and of the Senate, Count Dooku’s secession attempt was a threat to the Republic. Not merely due to undermining its stability, of course—though that was doubtless part of it, but due to the evidence of massive military buildup and hostile intent on Dooku’s part. Dooku certainly did intend to strike against the Republic: Palpatine needed a war, and it is certain the Separatists would have struck the first blow, if Palpatine had not be able to persuade the Republic to do so. The Jedi fought the Separatists because Dooku was a threat to the Republic, not because he was Sith.