Government is useful to solve the tragedy of the commons. Insecure devices are a negative externality. The government should tax insecurity (or fine device manufacturers that allow an attack) and use the revenue to subsidize software security efforts.