system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek] why does the Federation not have a larger military?

Their ships are constantly getting attacked, and on average once a year, they’ll face an extinction level event at the hands of some unknown alien menace. 

This doesn’t even account for the Klingons and Romulans, both heavily militarized starfaring empires who take frequent potshots at Federation vessels. I’m just talking about unexpected threats like the Borg, or pissed off space probes looking for whales. 

Given the frequency of their civilization getting wiped out, why hasn’t the Sol system been rebuilt into some sort of fortress?
gpt
Basically, the Federation doesn't want to. They've seen how the Klingons and Romulans live, and don't want that for their citizens.

The Federation is at the core a peaceful society, who will reluctantly take up arms in self-defense. When forced to fight, they will do so, but a standing full-time military would be a betrayal of the Federation's ideals. It would be committing to a military state, and an admission that their beliefs about peaceful coexistence are inherently flawed.

You can say that it's naive, you can say that it's a dumb decision given how dangerous the Galaxy is. But the Federation is idealistic to a fault.