Chloroplasts are necessary for carrying out photosynthesis.
Onions grow beneath the ground and are not the organs used for catching light and photosynthesizing. Leaves perform that function. However, it doesn't mean that onions do not have plastids, which are the organelles that chloroplasts belong to. Onion bulbs are modified stem structure which bear foliage leaves at the distal end. No chloroplasts because the bulbs are not the photosynthesizing tissues in onions.