I have the option to build a nuclear weapon. What does having one do for me? Can I use it on other players?
Developing Nukes will deduct 50,000 Heroism Points from you, and at the same time add +50,000 Demon points. This single action will immediately turn Snake into ‘Demon Snake’, with an abnormally long shrapnel horn and permanently stained costume.
Demon points are better explained in this question. As for their purpose, they just seem to limit who can attack your FOBs and have an extreme effect on your heroism/demon points, instantly turning you into Demon Snake (in most situations).
Every time I come across an FOB with a nuke, it says I can't attack it because I don't have a certain amount of Heroism. I assume you can infiltrate those bases without a nuke, you just need a certain amount of Heroism.
Supposedly, disarming enough nukes around the world in the virtual game-space will unlock a secret ending (which has already been data-mined if you want to see it anyway). The disarmament quota is supposed to be a joint one, so once enough nukes are disarmed across everyone's FOBs, the ending unlocks. Of course, that disarmament quota can't be reached without first having nukes to disarm, so building nukes so that they can be disarmed forwards progress towards that secret ending.
Link to the mined ending (obvious spoilers):