Preserve materials when joining meshes
Perhaps a more suitable way of generating instances would be with a Particle System?


CtrlG Make a Group of a proton and a neutron
Make an Emitter object, (maybe a rounded cube, to avoid crunching at the poles?)
Assign a Particle System to the emitter
No physics, start and end frames at 1
If you want to vary the proportion of neutrons and protons, you can 'Use Count' in the settings


Settings to taste, but this produced the illustrated result.




Now you can hit 'Convert' in the modifier stack of the emitter.. and..
..Ctrl ShiftA 'Make Duplicates Real'
Because the material is not dependent on Object ID,  Ctrl
J preserves materials