Most defense contractors also sell to multiple foreign countries, and many have civilian product lines. No one is forcing the rules of the stock market on them; some major defense contractors are privately held.
Actually, they do have a public product - it's called "corruption". They take taxpayer money intended for R&D, and instead use it to lobby the government to funnel more and more taxpayer money into their pockets each year. The public gets screwed and the large contractors get to walk away and buy more politicians.
Nothing about weapons systems, fighter jets, missiles, etc.. is intended for the civilian commercial market.