National security is extremely vital because it is the foundation for safety from external threats. National security protects the United States from threats from everything from terrorist attacks to nuclear war.
Without national security, a nation would easily and quickly be able to be invaded and overcome, leaving the citizens subjugated to another nation's rule, which likely would not have their best interests at heart. Every nation has some form of national security, and most have a standing military to enforce national security and/or alliances with other nations.
Even Canada, which many categorize as one of the most peaceful nations in the world, still maintains a standing military and has strict border laws so as to protect its government and national interests.
National security could be described as the most important function of a government because, were foreign powers allowed to attack a state and occupy it, the government would fall and cease to exist. In essence, protecting national security is the way that a government ensures its very survival. Any other function of the government relies on the success of its efforts to secure the country.
For example, imagine if the United States was being invaded by a foreign power. If the invasion were successful, another country’s soldiers would occupy the country and the other country’s politicians would begin making important decisions about what was to happen in the United States. In this case, national security is breached. Because it has failed, the US government is powerless to do any of the other things that it is in charge of, whether this be maintaining roads and bridges, funding the Food Stamp program, or investigating crimes. Instead, it is the new, foreign government that would be in charge of all of those things.