How does it work? By building rockets spacex learns how to build better rockets, by selling weapons it would only learn how to build weapons. If you mean someone could start another company selling weapons and redirect all profits to SpaceX, that could work, but why would anyone do that if there is a better way of selling network connection?