Are you talking about the chrome nut that clamps the upper triple clamp on the steering head bolt?

If so, it sounds like the upper triple clamp may not be seated against the bearing adjustment nut assembly below it. Otherwise, if the upper triple clamp is properly seated and is being squeezed by the large chrome nut it shouldn't loosen.

Loosen the large steering head nut. Loosen the clamp bolts at the fork tubes at the ends of the upper triple clamp. This lets the upper triple clamp float and slide on the fork tubes. Torque the steering head nut correctly. Retighten the clamp bolts at each end of the triple clamp to reattach the triple clamp to the fork tubes. Tightening the steering head clamp nut in this sequence will make sure the upper triple clamp is seated correctly and that the steering head nut is squeezing the upper triple clamp correctly.