Yes, but will the socially optimal level be provided by Govenrment?
You don't even know what such an optimum is.
With voluntary provision of public goods, people can donate towards defence on the basis of their market values.