Carbon dioxide is called greenhouse gas because it is:
Transparent to sunlight but traps heat
Materials like air, water, and clear glass are transparent. When light encounters transparent materials, almost all of it passes directly through them. A greenhouse gas is a gas in an atmosphere that absorbs and emits radiant energy within the thermal infrared range. This process is the fundamental cause of the greenhouse effect. Carbon dioxide and chlorofluorocarbons are examples of greenhouse gases.