If I remember the story correctly the balloon was, as you said, to detect nuke detonations. When it crashed the government lied because they didn’t want anyone to know what they were up to.
That method of detection wasn’t very effective anyway, we figured out much more reliable means of detecting nuclear explosions right on the ground using resonance, but it was pretty obvious the government was lying, so of course peoples imaginations went wild with conspiracies and the ufo thing was born.
It was (and still is) a great thing for the US government, it deflects from what’s really going on and keeps the idiots busy chasing bullshit, and the enemies guessing as to what kind of tech they may really have. Toss them a bone once in awhile to keep the frenzy going and you have a reliable means of obfuscation for little to no effort.
What happened is that a Colonel at the base it was brought to prematurely announced that it was some kind of alien craft, and then 4 hours later they clarified, but the damage was already done.
Of course, that was in '47 and Roswell didn’t become a “thing” until '69, more as a tourism gimmick than anything else.