That is because even many libertarians (i.e. not just capitalists, socialists, communists) understand that national defense, internal security, justice, and diplomacy are functions that the state should take care of.
There are very few who believe we should live in total anarchy.
Now unlike most other political currents, some believe that the aforementioned roles are the only role a government should serve (in french those roles are called the "Fonctions regaliennes de l'etat", literally "Roles kingly of the state").
It's really strange to use the army as an example of "socialism" when it's one of the really rare thing nearly everybody agree is a role belonging the state.