ID mask noisy when using Volume Scatter for World volume
ID masks are generated from sampling as far as I understand. The quality of them depends on the amount of samples set for the render. If it's noisy, you should increase the amount of samples for the render. It is worth noting that ID masks are also 2 bit black and white images so there is no anti-aliasing at all and that makes the usefulness of them very limited (some might even say 'completely useless'). For glare effects they are completely adequate, however, if you want good masks with anti-aliasing  for other purposes you should render them separately with shade-less materials made with emission shaders assigned to objects in the scene or another a lot better option would be to use Blender 2.80 that supports Cryptomatte that is way more convenient and powerful solution for generating masks.