The Galactic Republic is weird. It has no standing army, despite not controlling the entirety of the galaxy (the Outer Rim is mostly independent and who knows what's in the Unknown Regions!), and yet it allows planets, corporations, and others to have their own private armies.
When the Jedi talk about being peacekeepers, they're mostly going around stopping people from using their private armies against each other - something they fail to do in TPM. That's when the lightsabers come out and the Jedi switch to what Anakin calls "aggressive negotiations".
You could probably argue that the Trade Federation, using its seat in the Senate, has justified its private droid army as a means to defend itself against pirates in the Outer Rim and such. But due to the rampant corruption in the late Republic, they've started using it to bully small worlds like Naboo.