Ok, I’m not saying you need to agree with the principle, but the grammar clearly states that the citizens get guns because the government has a military (which is the well-regulated militia).
Again, not starting a debate on if that’s good or bad, just grammar.