According to Planck's law, all matter emits radiation at all wavelengths but is this statement true for gases and pure elements? Gases like hydrogen and helium have specific emission spectrums and I am having difficulties understanding how they can emit radiation at all wavelengths. Why does Planck's law include all matter and not just blackbodies?
Planck's law does not say "all matter emits radiation at all wavelengths". While generally true, that's not what Planck's law is about.
Planck's law is specifically about spectrum of EM radiation in thermodynamic equilibrium, or spectrum of beam of radiation coming from inside a region where radiation is in (approximately) thermodynamic equilibrium.
Real piece of radiatively uninsulated matter in vacuum never produces exactly radiation with such spectrum (blackbody radiation). This includes solid matter, liquids and gases. They all have frequency bands where they radiate less than blackbody at the same temperature, and in some cases, they may have bands where they radiate more than the blackbody.
It takes a good radiation insulation around a real emitting body to establish equilibrium radiation with Planck's spectrum in the enclosed region.
Atoms and molecules have sharp emissions lines or bands. Interaction between many such particles can broaden and shift the lines, and produce "blurred" spectrum where no lines or holes are easily detectable.
This happens mostly with liquids and solids, because particles are close to each other and interaction between them is strong.
Gases are usually different; interaction between the particles is weak, emission spectrum is usually made of sharp lines (but still with finite width) similar to those of single atom/molecules and between those lines there is little (but not zero) emission of radiation.